Models & providers
Two wire protocols cover everything — pick a provider during setup or re-run
bwn init. Environment variables override stored keys, so CI just works.
| Provider | Kind | Key |
|---|---|---|
| Anthropic (Claude) | remote | ANTHROPIC_API_KEY |
| OpenAI | remote | OPENAI_API_KEY |
| OpenRouter | remote | OPENROUTER_API_KEY |
| Groq | remote | GROQ_API_KEY |
| Hugging Face | remote | HF_TOKEN |
| Ollama | local | — |
| llama.cpp server | local | — |
| LM Studio | local | — |
| OpenAI-compatible endpoint | yours | CUSTOM_API_KEY (optional) |
Hot-swapping with /model
/model switches model and provider mid-session, and never claims success
without proof: a one-token probe through the real request path validates the key, the model
name, and the server before anything is saved. A missing API key is configured right in the
prompt; a stopped Ollama gets install/serve/pull steps; a failed probe keeps your current model.
/model gpt-4o # provider inferred and validated
/model ollama/qwen2.5-coder # checked against `ollama list` first
/model meta-llama/llama-3.3-70b # any OpenRouter model, by org/model name
/model http://localhost:8000/v1 my-model # any OpenAI-compatible server (vLLM, TGI, LiteLLM)
Custom endpoints work keyless (the vLLM default); if you configure
CUSTOM_API_KEY, bwn refuses to send it over plain HTTP to anything but a loopback
address.
Local models
The native Ollama path probes each model's real context window and sets num_ctx so
long prompts aren't silently truncated. Tool calls emitted as tagged text by small coder models
(Qwen2.5-Coder, Gemma) are parsed reliably — a 1.5B model actually writes files.
Vision
Image and video attachments are gated per model: every current Claude model accepts images; OpenAI-compatible and Ollama models are detected by name (gpt-4o/o3/gemini, llava, qwen-vl, gemma3, llama3.2-vision, moondream, …). Text-only models get an explicit notice instead of silently dropped attachments. See Multimodal input.
Keys live in ~/.buildwithnexus/.env.keys (0600).