Configuration: Providers, Models, and Presets
This page is the field-by-field reference for how navin chooses a provider, a model, and a named configuration. Use it together with:
| Need | Page |
|---|---|
| Pasteable recipes for a known provider | provider-cookbook.md |
| Matching keys, model IDs, and common failures | providers.md |
| Fallback chains when a provider fails | guides/configure-model-fallback.md |
| Custom OpenAI-compatible endpoints | guides/configure-openai-compatible-provider.md |
Config file: ~/.navin/config.json (created on first navin webui or CLI run). Prefer environment variables for secrets (${OPENROUTER_API_KEY}, etc.).
Mental Model
Three layers work together:
- Provider (
providers.<name>) - credentials and endpoint (API key,apiBase, OAuth, proxy). - Model configuration / preset (
modelPresets.<name>) - a named pair ofprovider+model, plus generation settings. - Active selection (
agents.defaults.modelPreset) - which preset the agent uses for normal turns.
In the WebUI this maps to:
| WebUI | Config |
|---|---|
| Settings → Providers | providers.* |
| Settings → Models → add configuration | modelPresets.* |
| Settings → Models → current configuration / Active badge | agents.defaults.modelPreset |
| Settings → Models → Task routing | modelRoutes |
A configuration name (label) is only a human-readable shortcut in the chat model selector. Prefer names that describe the model or its role, for example Claude Sonnet, GLM 5.2, or Everyday coding - not free-form task titles unrelated to the model.
Quick Start (WebUI)
- Open Settings → Providers and add an API key (or local
apiBase) for the service you use. - Open Settings → Models.
- Click Add model, pick the provider, pick a model ID from the catalog (or type one), give a clear configuration name, then Save.
- Select that configuration as Current configuration so it shows the Active badge.
- Optionally open Task routing and assign cheaper or stronger presets to roles (
fast,dev,deep, …). Matching workflows (/forge,/blueprint, studios, audits…) pick that model automatically; you can also switch with/pilot <task>.
Verify outside the chat:
navin status
navin agent -m "Hello!"
Providers
Shape
{
"providers": {
"openrouter": {
"apiKey": "${OPENROUTER_API_KEY}"
},
"anthropic": {
"apiKey": "${ANTHROPIC_API_KEY}"
},
"ollama": {
"apiBase": "http://127.0.0.1:11434/v1"
},
"custom": {
"apiKey": "${CUSTOM_API_KEY}",
"apiBase": "https://api.example.com/v1"
}
}
}
Fields
| Field | Meaning |
|---|---|
apiKey | Credential. Prefer ${ENV_VAR} references. |
apiBase | HTTP base URL. Usually required for local servers and custom endpoints; often omitted for built-in hosted providers. |
apiType | Only for providers.openai: auto, chat_completions, or responses. |
proxy | Optional HTTP proxy for OpenAI-compatible / Codex paths. Not used by native Anthropic, Bedrock, Azure OpenAI, or GitHub Copilot backends. |
extraHeaders / extraBody / extraQuery | Provider-specific request extensions (gateways, Azure-style query params). |
Common provider names
Use the registry name in presets (provider: "openrouter"), not the display label.
| Kind | Examples |
|---|---|
| Hosted direct | openai, anthropic, gemini, deepseek, mistral, groq |
| Gateways | openrouter, opencode / opencode_zen, opencode_go, huggingface, siliconflow |
| Cloud / enterprise | azure_openai, bedrock, github_copilot |
| Local | ollama, vllm, lm_studio, atomic_chat, ovms, custom |
| OAuth / subscription | openai_codex, github_copilot (login via navin provider login …) |
Full matching rules and failure tables: providers.md. Pasteable recipes: provider-cookbook.md. Guided Ollama install: guides/configure-ollama-local.md.
Bedrock notes
AWS Bedrock uses the native Converse API. Prefer AWS_BEARER_TOKEN_BEDROCK or your usual AWS credential chain, set provider: "bedrock", and use Bedrock model IDs (for example anthropic.claude-sonnet-4-5-v1:0). Do not mix OpenRouter-style IDs with the Bedrock provider.
Model Configurations (Presets)
Shape
{
"modelPresets": {
"primary": {
"label": "Claude Sonnet",
"provider": "openrouter",
"model": "anthropic/claude-sonnet-4.5",
"maxTokens": 8192,
"contextWindowTokens": 65536,
"temperature": 0.1,
"reasoningEffort": "medium"
},
"economy": {
"label": "GLM 5.2",
"provider": "openrouter",
"model": "z-ai/glm-5.2",
"maxTokens": 4096,
"contextWindowTokens": 65536,
"temperature": 0.1
}
},
"agents": {
"defaults": {
"modelPreset": "economy"
}
}
}
Fields
| Field | Meaning |
|---|---|
Key (primary, economy, …) | Stable internal name. Referenced by modelPreset, fallbackModels, and modelRoutes. Cannot be default (reserved). |
label | Display name in WebUI / chat selector. |
provider | Registry provider name that owns the request. |
model | Model ID as that provider expects it (gateway IDs often include a vendor prefix). |
maxTokens | Max completion tokens for a turn. |
contextWindowTokens | Context budget navin uses when building prompts. |
temperature | Sampling temperature. |
reasoningEffort | Optional thinking effort (low / medium / high / adaptive / none) when the model supports it. |
Implicit default preset
If you do not create named presets, navin builds an implicit configuration named default from agents.defaults.model, provider, maxTokens, and related fields. Named presets are clearer for switching and fallbacks.
Selecting the active configuration
{
"agents": {
"defaults": {
"modelPreset": "economy",
"provider": "auto",
"model": "…"
}
}
}
- Prefer
modelPresetpointing at a key undermodelPresets. - Direct
provider+modelonagents.defaultsstill work for older configs and for the reserveddefaultpreset. - In chat, switch models from the model selector or with commands such as
/model//pilotdepending on setup.
Task Routing (modelRoutes)
Assign a named model configuration (preset key under modelPresets) to each kind of work so expensive frontier models are only used when needed. Values are preset names such as primary or economy - not free-form task titles.
{
"modelRoutes": {
"deep": "primary",
"dev": "primary",
"fast": "economy",
"search": "economy",
"plan": "primary",
"review": "primary",
"security": "primary",
"docs": "economy"
}
}
| Role | Typical use |
|---|---|
deep | Architecture, hard debugging, large refactors |
dev | Everyday coding |
fast | Short questions, renames, commit messages |
search | Web research turns |
plan | Specs and step breakdowns |
review | Diff / code review |
security | Audits and permission-sensitive work |
docs | READMEs, summaries, writing |
Automatic application
When a message starts with a workflow slash command, navin selects the routed preset for that turn (it wins over the chat model picker for that turn). Plain chat without a workflow command keeps the active / thread model.
| Role | Applied automatically by |
|---|---|
plan | /blueprint, /board |
dev | /forge, /mobile, /ops |
deep | /risklens, /debug |
security | /fortify, /probe, /unmask, /lineage, /xray, /gatekeeper, /perimeter, /bastion, /vault, /threatmap, /redteam, /comply, /recon, /dast, /pentest |
review | /inspect, /turbo |
docs | /atlas, /report, /studio, /campaign, /team, /leads, /seo |
search | /scrape |
fast | /pulse, and the Code editor inline assist |
Configure the map in Settings → Models → Task routing (same as modelRoutes in config).
Manual switch (/pilot)
In chat: /pilot lists routes; /pilot review (for example) switches the session preset to the one assigned to that role (in memory until restart or another switch). Prefer automatic routing for workflows; use /pilot when you want to stay on a role across free-form turns.
Model Fallbacks
When the active provider fails or rate-limits, navin can try other presets in order:
{
"agents": {
"defaults": {
"modelPreset": "primary",
"fallbackModels": ["economy", "localSmall"]
}
}
}
- Entries are preset names, not raw model IDs (unless you use an inline object; see
providers.md). fallbackModelslives underagents.defaults, not inside each preset.- Context is built for the smallest window in the active chain so every candidate can accept the same prompt.
Step-by-step: guides/configure-model-fallback.md.
End-to-End Example
OpenRouter as gateway, one strong preset, one cheap preset, routing, and fallback:
{
"providers": {
"openrouter": {
"apiKey": "${OPENROUTER_API_KEY}"
}
},
"modelPresets": {
"strong": {
"label": "Claude Sonnet",
"provider": "openrouter",
"model": "anthropic/claude-sonnet-4.5",
"maxTokens": 8192,
"contextWindowTokens": 65536,
"temperature": 0.1
},
"fast": {
"label": "GLM 5.2",
"provider": "openrouter",
"model": "z-ai/glm-5.2",
"maxTokens": 4096,
"contextWindowTokens": 65536,
"temperature": 0.1
}
},
"modelRoutes": {
"deep": "strong",
"dev": "strong",
"fast": "fast",
"docs": "fast"
},
"agents": {
"defaults": {
"modelPreset": "fast",
"fallbackModels": ["strong"]
}
}
}
Naming Rules That Avoid Confusion
- Configuration label: what you see in the list (
Claude Sonnet,GLM 5.2). - Preset key: stable id in JSON (
strong,fast) - used by routes and fallbacks. - Provider name: registry id (
openrouter,anthropic). - Model id: exact string the provider API accepts (
anthropic/claude-sonnet-4.5on OpenRouter vsclaude-sonnet-4-5on Anthropic direct).
Never mix a key from provider A with a model id that only exists on provider B. That is the most common first-run failure.
Related Agent Defaults
Useful neighbors under agents.defaults (not exhaustive):
| Field | Role |
|---|---|
modelPreset | Active named configuration |
fallbackModels | Ordered backup presets |
maxToolIterations | Cap on tool-calling loops per turn |
timezone / botName / botIcon | Display and scheduling context |
reasoningEffort | Default thinking effort when the preset omits it |
workspace | Project folder the agent treats as home |
Environment-level overrides: environment-variables.md.
Gateway Heartbeat
When navin gateway runs, heartbeat periodically reads <workspace>/HEARTBEAT.md, runs quiet workspace checks, and only notifies a chat target when something actionable appears.
Default shape under gateway.heartbeat:
{
"gateway": {
"heartbeat": {
"enabled": true,
"interval_s": 1800
}
}
}
Use heartbeat for low-noise watch loops. Use scheduled automations when every run should produce a visible reminder. Details: automations.md.
Langfuse Observability
navin can wrap supported OpenAI-compatible calls with Langfuse when the langfuse package is installed and these env vars are set before startup:
LANGFUSE_SECRET_KEYLANGFUSE_PUBLIC_KEYLANGFUSE_BASE_URL(for examplehttps://cloud.langfuse.com)
Full install and verification steps: guides/configure-langfuse-observability.md. Recipe notes: provider-cookbook.md.
Checklist
- Provider block has a valid key or local
apiBase. - Preset
providermatches that block’s registry name. - Preset
modelis a real ID for that provider (use the WebUI catalog when unsure). agents.defaults.modelPresetpoints at an existing preset key (ordefault).- Route and fallback entries only reference existing preset keys.
navin agent -m "Hello!"succeeds before debugging chat channels.
See Also
providers.md- matching, gateways, local servers, diagnosisprovider-cookbook.md- copy-paste recipesguides/configure-model-fallback.mdguides/configure-openai-compatible-provider.mdmy-tool.md- runtime self-inspection