Run locally
You're Claude Code, working in my repository.
Task
Pick the run-locally path that fits this machine (Muse Spark Open across two or four Mac Studios with MLX, or Muse Glimmer with llama.cpp, Ollama or vLLM on one GPU), tell me which and why, then set it up here: start the OpenAI-compatible server and add a client that calls it.
Read this first
Meta's docs page "Run locally" as Markdown: https://dev.meta.ai/docs/cookbook/run-locally.md
It's the source of truth for request and response shapes. The same page for people: https://dev.meta.ai/docs/cookbook/run-locally
Setup
- Server: the model runs on hardware you control, behind an OpenAI-compatible server (SGLang, vLLM, llama.cpp or another runtime this page covers). Code takes the server's base URL from configuration (such as http://127.0.0.1:8000/v1) and sends the model name it serves (GET <base URL>/models lists it).
- Auth: a local server takes any placeholder key unless it was started with one; read a real key, and any token a download needs, from the environment. Never hard-code, print or commit a key or token.
- Python: the OpenAI SDK (pip install openai) with base_url set to the server's /v1 and a placeholder api_key, or plain requests.
Facts to get right
- Muse Spark Open on Mac: two Mac Studios with M5 Ultra and 512 GB, or four with 256 GB; macOS 26.2 or later; a direct Thunderbolt 5 link between every pair; mlx.launch with --backend jaccl.
- Muse Glimmer: about 19 GiB for the 17 GB GGUF with images at 131K context (llama.cpp b10353 or newer), Ollama 0.32.7 or later, or 72 GB of VRAM for bf16 on vLLM.
Starter code (Python)
import os
from openai import OpenAI
client = OpenAI(base_url=os.environ.get("LOCAL_BASE_URL", "http://127.0.0.1:8000/v1"), api_key="unused")
model = client.models.list().data[0].id # the model the server is serving
response = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "In one sentence, what are you good at?"}],
max_tokens=4096,
)
message = response.choices[0].message
print("Reasoning:", getattr(message, "reasoning_content", None) or getattr(message, "reasoning", None))
print("Answer:", message.content)
Done when
- The chosen server answers GET /v1/models.
- A chat request returns an answer.
- Any key or token comes from the environment and never appears in code, logs or commits.2,354 characters
Serve a Muse open-weight model on your own machines, step by step. Return to the Cookbook for other patterns.
- Muse Spark Open on MacRun Muse Spark Open on two or four Mac Studios.
Mirrored from dev.meta.ai/docs/cookbook/run-locally (synced Oct 30, 2026). Text and examples © Meta. Live demos run on Muse Muse's key.