Skip to content

Models

Markdown

The inference block names the model and how Loom reaches it. Changing models is a change to the bundle, never to code.

inference:
provider: anthropic # or openai, openrouter
model: claude-haiku-5-5

The key comes from <PROVIDER>_API_KEY in the environment (ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY), or from a vault reference with secret_ref: vault://<namespace>/<name>. Keys never go in the bundle itself.

Any OpenAI-compatible server works: Ollama, vLLM, llama.cpp, LM Studio. Name it anything and give its endpoint:

inference:
provider: local
model: qwen3:4b
endpoint: http://127.0.0.1:11434/v1
location: local

location is a declaration Loom checks at load. With provider: local, the endpoint must be on loopback.

inference:
provider: mlx
model: "~/models/Qwen3-4B-4bit"
location: local

Install the extra once with uv sync --extra mlx.

claude-cli and codex-cli run the claude or codex CLI as a subprocess, signed in as you, with no API key. They can keep a session between calls with session: keep.

inference:
provider: claude-cli
model: haiku

provider: host means the app embedding Loom supplies the model itself, such as Apple Foundation Models in an iPhone app. See Embed Loom.

Loom always validates the model’s answer against a schema. Today it asks for JSON in the prompt, parses it and validates it, and on failure sends the errors back and asks again. That works with every model. Validation is never skipped, whatever the model.