Model Configuration
Myrm uses LiteLLM for unified access to 100+ models from 26+ built-in providers, with three compatibility protocols (OpenAI-like, Gemini-like, Anthropic-like) for infinite custom provider extension. Each built-in provider comes with pre-filled API URLs and supports one-click domestic/international region switching — truly zero-configuration ready.First-Time Setup
When you first launch Myrm, the onboarding wizard guides you through model configuration:- Local model auto-detection: Myrm automatically scans for running Ollama or LM Studio instances and recommends the best available model with a one-click activation button.
- Cloud Quick Start: No local GPU? The wizard shows cloud providers with free tiers — Google Gemini, SiliconFlow (registration credits), and OpenRouter (free open-source models) — with one-click navigation to the configuration page.
- Smart Routing onboarding: When two or more models are configured, the wizard offers a one-click Smart Routing activation. It auto-classifies your models into quick/standard/reasoning tiers and shows estimated cost savings (40–70%). Enable it to automatically route simple messages to lighter models while reserving powerful models for complex tasks.
- Workspace theme pick: As the final wizard step, choose one of three curated Theme Profiles (Official Default, Calm Readable, Ocean) or skip to keep the default. Your choice syncs via ConfigSync to chat, kanban, and settings — and Agent HTML widgets inherit the same colors automatically.
- Persistent guidance: Even if you skip the wizard, a gentle banner on the chat screen reminds you to configure a model provider before you can start chatting.
Cloud (Hosted): Zero-Configuration by Default
In Cloud-hosted mode you can start chatting without configuring anything. When your dedicated sandbox first boots, Myrm automatically provisions a platform-hosted lite model (routed through the control plane’s LLM Relay):- Type and go — a platform-hosted model is ready the moment your sandbox starts. No API key, no provider setup, no model selection required.
- Bring Your Own Key later — connect your own provider credentials in Settings > Models at any time to use your preferred models and quotas.
- Never overwrites your setup — the automatic provisioning is idempotent: if you (or a team admin) have already configured providers, your configuration is left untouched. You always keep full control.
- One meter, one budget — usage of the platform-hosted model draws from the same transparent Work Unit balance as everything else.
Adding API Keys
Navigate to Settings > Models or set environment variables:Smart Routing
The 3-dimensional complexity router automatically selects the optimal model based on task requirements, privacy sensitivity, and provider health: Phase 1 — Rule Engine (zero LLM cost): Multi-dimensional scoring across 6 signal types — keywords (30+ bilingual), code blocks, math/LaTeX, URLs/file paths, images, and message length. 99% of requests resolve instantly. Phase 2 — LLM Judge (ambiguous only): For borderline cases, a lightweight judge model classifies the query. Results are SHA-256 cached (5-min TTL, 256-entry LRU) to avoid repeated calls. Session Momentum: Short follow-ups (e.g., “ok”, “yes”) inherit the session’s complexity tier instead of being downgraded to SIMPLE. Message-length-based weight decay ensures long messages are classified independently. PenaltyTracker — Self-Learning: When you flag a routing decision as incorrect, the tier receives a penalty score (24-hour half-life). Future queries need stronger signals to activate penalized tiers, making routing accuracy improve over time. User Model Preference Memory (Dialectic Derivation): The Harness memory extraction engine automatically derives user model affinities and task-model associations in background passes (e.g. Claude 3.7 for coding, DeepSeek-R1 for reasoning), persisting structuredmodel_affinity profiles. Strictly adhering to the “Explicit Config > Global Default > Preference Suggestion” hierarchy, it delivers transparent personalized recommendations while preserving 100% prompt cache stability.
Fast Lane: Tasks classified as SIMPLE skip the heavy middleware pipeline and go directly to the model with minimal overhead. This reduces response latency by ~30-50% for everyday chat, greetings, and short follow-ups — the messages you send most often feel the fastest.
Model Speed Test
Before committing to a model, test its real-world performance right from Settings. Go to Settings > Model Service and click the speed test button in the top-right corner. What it measures:- TTFT (Time to First Token) — How quickly the model starts responding
- TPS (Tokens per Second) — Sustained generation throughput
- Total tokens — Full response length for the test prompt
- Click Run All to benchmark every enabled model in sequence
- Click the retry icon on any individual model to retest it
- Results show success/error status with color-coded badges
Thinking Intensity Control
For reasoning-capable models (Claude 3.7+, o1/o3/o4-mini, Gemini 2.5, DeepSeek R1, DeepSeek-Reasoner, Qwen3, etc.), Myrm provides fine-grained control over how deeply the model “thinks” alongside intelligent multi-tier onboarding routing. Hybrid Open/Closed-Source Smart Routing (Onboarding): In the onboarding wizard, Myrm natively reuses the rigorously tested single source of truth (isReasoningModelByName) to accurately identify official deepseek-reasoner and front-line thinking models. When both self-hosted local endpoints (Ollama / split-stack LAN) and commercial cloud models are detected, the system heuristically recommends the local model for zero-marginal-cost routine throughput (lite) and the cloud frontier model for complex fallback reasoning (reasoning), reducing overall API expenses by 75%+ out of the box.
6 preset levels: Off / Low / Medium / High / Extra High / Max — covering everything from quick answers to deep multi-step reasoning.
Custom token budget: Enter any value (e.g. 16384) to set a precise thinking budget for providers that support it (like Claude’s budget_tokens).
Per-model memory: Your intensity preference is automatically saved per model. Switch between Claude and GPT — each remembers its own last setting. No re-configuration needed.
Auto-detection: The thinking intensity button only appears when the current model supports reasoning. Non-reasoning models (e.g. GPT-4o-mini) show no button — zero clutter. Detection uses a dual-layer approach: API-reported capability takes priority, with regex fallback covering 25+ model families.
The selected intensity is passed through the full pipeline — frontend model_kwargs → server passthrough → harness extra_body → LiteLLM → provider API — with zero framework coupling.
Thinking Headroom (automatic): All major reasoning models (Claude 4.6+, DeepSeek R1, OpenAI o-series, Gemini 2.5+) count thinking tokens against the max_tokens budget. If max_tokens is too small, the thinking phase exhausts the budget before the response starts — causing truncation. Myrm automatically raises max_tokens to a safe floor based on the selected thinking intensity (8K for low, 16K for medium, 32K for high, 65K for xhigh/max). When no intensity is explicitly set, a conservative 16K default floor is applied since all thinking models default to thinking-on. This works alongside stream recovery as a dual-layer defense — proactive prevention plus reactive fallback. The adjustment is completely transparent and does not increase API costs (providers bill actual tokens used, not the max_tokens ceiling).
Reasoning Model Answer Extraction
DeepSeek-R1, Qwen-QwQ, OpenAI o-series, minimax M3 and other reasoning models put their final answer inreasoning_content instead of content. For most agent frameworks this is a silent trap — generated scripts, tool results, and UI output end up empty or printing None.
Myrm extracts the user-visible answer through a model-agnostic extraction layer that automatically:
- Falls back to
reasoning_contentwhencontentis empty — reasoning models work out of the box, no per-model whitelist to wait for - Strips
<think>…</think>blocks everywhere in the pipeline — answers stay clean, no raw thinking leaking into scripts, wiki articles, or structured results - Tolerates Anthropic block lists and plain-string responses — one extraction path for every provider
Per-Model Prompt Adaptation
Different AI models have different behavioral tendencies. Myrm automatically adapts its system prompt for each model family to get the best results:- GPT / Codex / Grok: Tool persistence enforcement, mandatory tool use for facts, act-don’t-ask bias
- Claude: Disclaimer minimization, execution-first mindset
- Gemini / Gemma: Absolute file path construction, dependency verification
- DeepSeek / Qwen / GLM: Concise Chinese-aware discipline
- Claude Opus 5+: Automatic behavioral tuning for three Anthropic-documented issues — scope expansion (doing more than asked), self-correction narration (unnecessary “I was wrong” statements), and default verbosity (responses longer than needed)
In-Chat Model Transparency
Every assistant message shows a Token Economics badge in the action bar. Click it to see exactly which model handled the request, how it was routed, what it cost, and how fast it ran:- Model name & routing tier — see the exact model (e.g.
gpt-4o,claude-sonnet-4) and its routing classification (Simple / Standard / Reasoning) - Prompt cache hit rate — percentage of cached tokens, estimated dollar savings, and cache-break attribution when the cache is invalidated
- Cost breakdown — per-message cost with actual/estimated badge, multi-model breakdown when routing uses multiple models, and per-tool token consumption
- Performance baseline — TTFT, tokens-per-second, and latency compared to your session average, with color-coded delta indicators
- Context budget ring — circular progress showing context window usage with healthy/warning/critical thresholds
- Privacy level — data sensitivity classification (S1 Public / S2 Internal / S3 Confidential) and routing path (local / cloud)
Key Rotation
Add multiple API keys per provider and Myrm automatically rotates them with smart failover. When you have 2+ active keys, a strategy selector appears in the pool status bar — pick the rotation mode that best fits your setup:
On rate-limit errors, the pool applies exponential backoff with ±15% jitter and automatically switches to the next available key — users never notice the switch.
Privacy Routing
Myrm’s Privacy Routing automatically selects cloud or local models based on data sensitivity — no manual switching required:
Privacy Routing wraps the model behind a standard interface. Agents, middlewares, and the execution loop are completely unaware of the routing — they interact with a normal model.
Combined with Ollama, LM Studio, or vLLM for local backends, this enables fully air-gapped operation for sensitive workloads.
Model Orchestration Playbook
To help users understand multi-model specialization and token economics, Myrm provides an interactive Model Orchestration Playbook on the empty chat landing page and in Settings:- Brain & Hands Synergy: Employs reasoning models (e.g., Claude 3.7 Sonnet, DeepSeek-R1) as the “Brain” for planning and architecture, while utilizing lightweight, high-throughput models (e.g., GPT-4o-mini, Gemini Flash) as the “Hands” for frequent tool execution and verification.
- Three Golden Recipes:
- Frugal: 100% lightweight models for high-frequency queries and monitoring, reducing token costs by 85%+;
- Balanced Brain & Hands: Top-tier reasoning planning paired with swift tool execution, achieving a 4x token economic advantage;
- Consensus (MoA): Multi-model cross-validation to eliminate single-model hallucinations for security-sensitive workflows.
- In-Place Subscription Discovery: Instant authorization with existing subscriptions like GitHub Copilot, ChatGPT Plus/Pro, xAI SuperGrok, and Claude Pro without needing separate API credits.
Vercel AI Gateway & Spend Observability
Myrm natively integrates Vercel AI Gateway as a first-class provider preset:- Zero Vendor-Prefix Hijacking: Composite model IDs (e.g.,
anthropic/claude-3-5-sonnet) automatically receive an internalopenai/protocol shield, guaranteeing communication via the OpenAI-compatible wire protocol and preventing SDK routing conflicts. - Automatic Attribution Headers: Requests sent to
ai-gateway.vercel.shautomatically injectHTTP-Referer: https://myrmagent.aiandX-Title: Myrm Agentheaders for transparent attribution in the Vercel dashboard. - Dashboard Deep Links: Quick access links directly to the official Vercel AI Gateway metrics page right from the provider card.
Local Models & Hardware Cookbook
Myrm auto-detects local model services and your hardware capabilities for a zero-friction local AI experience: First Launch — Auto-Discovery: During onboarding, Myrm probes for Ollama and LM Studio on their default ports. If found, it offers one-click activation — configuring the provider, selecting the recommended model, and setting it as default in a single step. Hardware Cookbook: In Settings, the Hardware Cookbook panel displays your machine’s specs (CPU, RAM, GPU, VRAM, disk space) and calculates a Fit Score for each available local model. Models are rated perfect / good / fair / poor based on your VRAM or RAM. The download button is disabled when disk space is insufficient, preventing system hangs from downloading models that won’t fit. Inference Speed Preview (~tok/s): Alongside the VRAM estimate, Myrm shows a pre-download inference speed badge for each model, calculated from your GPU’s memory bandwidth and the model’s parameter count (Q4_K_M quantization). Speed is color-coded for instant readability:- 🟢 ≥ 20 tok/s — smooth, real-time conversation
- 🟡 8–19 tok/s — usable with slight latency
- 🔴 < 8 tok/s — noticeably slow for live chat
Config Auto-Healing
All model configuration values are automatically sanitized on save, preventing common copy-paste errors from causing connection failures:- API URL — trailing slashes and whitespace removed (prevents 404 errors)
- API Key — leading/trailing spaces and newlines stripped (prevents auth failures)
- Model name — extra whitespace removed (prevents model-not-found errors)
- Empty values — converted to unset state gracefully (prevents crashes)
- Legacy providerType values — old exports that used bare ids like
openaiinstead ofopenai-likeare auto-normalized on load; routing falls back to the provider id instead of crashing the app - Developer System Health — the context bundle health panel calls
/context-bundleunder the API base URL (never double-prefixes/api, which would 404)
Multi-Device Config Sync
Myrm keeps settings consistent across browser tabs, desktop app, and SaaS — without nagging you on every refresh. What you get:- Change language, TTS, or model defaults on your phone — your desktop picks it up automatically
- Open multiple tabs or hard-refresh — no false “Configuration Conflict” dialogs
- Work offline — changes queue locally and sync when you’re back online
- Break something? Config Time Machine rolls back any key to a previous version
- Smart merge — if two devices edit different fields, both changes apply automatically
- Honest conflicts — if two devices edit the same field, you choose which version to keep
- Same-device silence — your own tab refreshing never triggers a conflict prompt
- Idempotent sync — identical content never bumps version numbers or creates noise
Network Proxy (For Restricted Networks)
Myrm automatically respects your system’s proxy settings — if you already have a VPN or proxy (e.g., ClashX, V2Ray) configured at the OS level, all LLM API calls will route through it with zero additional configuration. How it works:- The HTTP client (
httpx) defaults totrust_env=True, automatically readingHTTP_PROXY/HTTPS_PROXY/ALL_PROXYenvironment variables - System-level proxy settings (macOS Network Preferences, Windows Internet Options) are automatically applied
- No restart required — proxy changes take effect on the next API call
Vision Fallback
When your main model does not support vision, set a Vision Fallback model in Settings → Models. Myrm automatically converts attached images into text descriptions before sending them to the main model — with live progress in chat and session-level caching for duplicate images. GUI tools (2026-07-31):- Test vision chain — probes the full ordered provider chain and shows which model answered (or which step failed).
- Use this model — when your main model is text-only, one-click recommend from enabled vision-capable providers.
- Chat attach warning — if vision is missing, a toast with Go to Settings deep-links to the Default Models tab.
Multi-Model Advisor Overlay (MoA)
Lightweight reference models advise your acting model before each tool-loop iteration — without changing the main model binding. Ideal for contract review, architecture decisions, and cross-checking high-stakes answers. Setup (one time per Agent Profile): Settings → Agent → Capabilities → Agent-Loop Advisor Overlay — enable, add 1+ reference models, tune fan-out / privacy / output limits. Per chat session: Open the model picker next to the input → Mixture of Agents group → choose Standard, Deep Review, or Fast (or click again to turn off). MoA runs only when a preset is selected — no extra ref calls otherwise. Selection persists tochats.active_moa_preset_id (survives refresh and cross-device sync); incognito chats never read or write MoA preference.
Preset intensity (same reference pool, different runtime params):
- Standard — profile defaults
- Deep Review — higher reference reasoning effort
- Fast — lower effort + tighter reference output cap
- Fan-out Policy —
Once per user turn(default),Every model call, orEvery N model calls - Advisor Privacy Filter —
Off/Display only/Full - Reference Output Limit — default 600 tokens (cost control)
- No reference models → overlay skipped (amber warning, no silent fake MoA)
- Budget pressure / unattended runs → overlay auto-skipped
ConsensusThinkingPanelshows each advisor via SSEmoa_ref_done- Prompt Cache safe — advisors inject transient context only (no SystemMessage mutation)
Note: Standalone Consensus ActionMode was removed; legacy APIHermes migration: On wizard confirm, defaultaction_mode=consensusreturns 400 — useaction_mode=agentwithactive_moa_preset_idinstead.
moa.presets reference models are written to the target Agent overlay (hermes_moa_migrator). See Data Migration — Hermes MoA Reference Import.
Verified (2026-08-03, rerun 189): MoA picker 54 targeted unit tests (11 FE vitest + 43 server pytest, 0 failures) — PATCH rollback, org-policy MoA refs, consensus 400 reject, active_moa_preset_id serialization. Chrome MCP / API overlay E2E still pending (see materials doc). See MULTI_MODEL_CONSENSUS_ADVANTAGE.md.
Complete token economics visualization pipeline from backend to frontend:
Tool Schema Auto-Normalization
When you switch between models (e.g., GPT-4o → Gemini → Claude), each provider has different requirements for tool schemas. Myrm automatically normalizes all tool schemas before sending them to the model — no manual configuration required. What it fixes automatically:- Orphan
requiredentries (fields listed as required but not defined in properties) — causes 400 errors on Gemini/Vertex AI - Nested nullable patterns (
anyOf: [{type: X}, {type: null}]) — causes errors on strict OpenAI function calling $ref/$defsinline definitions — most providers don’t support JSON Schema references- Missing
typeannotations on nested objects — strict providers reject them - Anthropic-unsupported keywords (
minimum,maxItems,pattern, etc.) — constraints are folded into description
Fault Tolerance
The 14-layer error recovery system handles failures automatically:- Rate limit errors (4-strategy key rotation + credential pool + ManagedLLM/KeyPool in-agent failover)
- Provider outages (Circuit Breaker with 3-tier cooldown + fallback presets)
- Stream interruptions (token-level precise resume)
- Response truncation (progressive output budget boost 2x → 3x → 4x)
- Oversized images (automatic re-encoding and compression)
- Model thinking mode errors (automatic mode adjustment and retry)
- Empty responses (parameter adjustment and retry)
- Iteration limits (grace-call summary — users never see a blank response)