Providers¶
A provider is a remote inference service. OpenMed supports OpenAI (via an API key or a ChatGPT OAuth sign-in), Anthropic, OpenRouter, Xiaomi MiMo token plans, Doubleword, and custom endpoints for the interactive agent. Doubleword also supports async Responses and 24-hour JSONL batches. The interactive agent uses the same medical tools, workflows, and audit trail across providers.
This page covers credentials, model selection, and the behaviour specific to each provider. For runtime settings that are not provider-related, see Configuration.
Choosing a provider¶
| Provider | Auth | Use it for |
|---|---|---|
| OpenAI | OPENAI_API_KEY (recommended), or ChatGPT sign-in (experimental) |
The default path. GPT-6.1 Sol and GPT-6 models. |
| Anthropic | ANTHROPIC_API_KEY |
Claude models, with prompt caching enabled by default. |
| OpenRouter | OPENROUTER_API_KEY |
Models beyond the OpenAI and Anthropic lists — Gemini, Kimi, GLM, Qwen, Llama and several hundred more, on one key. |
| MiMo | MIMO_API_KEY (starts with tp) |
Xiaomi MiMo token-plan subscriptions, with four native models ready to select. |
| Doubleword | DOUBLEWORD_API_KEY |
Real-time TUI, async flex Responses, and 24-hour bulk inference. |
| Custom | optional key | One or more OpenAI-compatible servers you operate — vLLM, SGLang, llama.cpp, Ollama, LM Studio, or gateways. |
Each provider resolves its own credentials. MiMo uses only its token-plan key and fixed endpoint; it never falls back to an OpenAI, Anthropic, or OpenRouter key.
All Doubleword modes use the same Doubleword key (from the environment or
provider secrets) and the fixed
https://api.doubleword.ai/v1 endpoint. See Doubleword for mode
selection, interactive use, Responses jobs, and batches.
You can configure more than one at a time. Which provider handles a request is decided by the model you select — see How a provider is selected.
Where credentials live¶
| Path | Holds |
|---|---|
~/.openmed/auth.json |
ChatGPT OAuth tokens, written by openmed login |
~/.openmed/provider_secrets.json |
Provider API keys shared by interactive, async and batch requests, per-provider model lists, and custom endpoints |
~/.openmed/settings.json |
Runtime behaviour such as permission mode, and your saved default model — not secrets |
Store keys without hand-editing JSON:
openmed config provider-set openai --api-key "sk-..."
openmed config provider-set anthropic --api-key "sk-ant-..."
openmed config provider-set openrouter --api-key "sk-or-..."
openmed config provider-set mimo --api-key "tp-..."
openmed config provider-set doubleword --api-key "sk-..."
openmed config provider-show
provider-show reports which providers are configured without printing secret values. To remove a stored key, use --unset-api-key with the same command.
Editing the file directly¶
provider-set writes ~/.openmed/provider_secrets.json with 0600 permissions. An apiKey may be a literal string, or an {env:VAR_NAME} reference that resolves at load time — useful when the file is synced between machines and you would rather not store the secret in it:
{
"provider": {
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}",
"models": ["gpt-7"]
}
},
"anthropic": {
"options": {
"apiKey": "{env:ANTHROPIC_API_KEY}",
"models": ["claude-opus-6"]
}
},
"openrouter": {
"options": {
"apiKey": "sk-or-v1-...",
"models": ["qwen/qwen3.8-27b", "z-ai/glm-5.2"]
}
},
"mimo": {
"options": {
"apiKey": "{env:MIMO_API_KEY}"
}
},
"doubleword": {
"options": {
"apiKey": "{env:DOUBLEWORD_API_KEY}"
}
},
"custom": {
"options": {
"endpoints": [
{"baseURL": "http://localhost:8000/v1", "model": "Qwen/Qwen3.8-27B", "apiKey": "{env:MY_SERVER_KEY}"}
]
}
}
}
}
Only the custom section carries endpoint URLs (inside its endpoints
list) — hosted provider endpoints are fixed, and a stored baseURL on them
is ignored and stripped. The gpt-7 and claude-opus-6 entries stand for IDs
newer than the built-in list; see
Default model and newer models.
One JSON object, one provider map
Every provider is a key inside the single provider object above. A
common mistake is to paste a second example after the first, which produces
two objects and makes the whole file invalid — at which point all your
keys are ignored and every provider shows as not configured. If that
happens, openmed config provider-show names the file and the line.
A flatter shape is accepted as an alternative to the block above — use one or the other, never both in the same file:
{
"openrouter": {
"api_key": "{env:OPENROUTER_API_KEY}",
"models": ["qwen/qwen3.8-27b", "x-ai/grok-4.6"]
}
}
Check the file is valid at any time:
It prints which providers are configured, and exits non-zero with the parse error if the file is malformed.
Precedence is explicit runtime config → environment variable → this file → default. Provider config is read once per process, so restart OpenMed after editing the file by hand. In the TUI, opening /model also reloads it.
Default model and newer models¶
Providers retire models and release new ones on their own schedule. OpenMed's built-in model list is a starting point, not a limit, and everything in this section works with the OpenMed you have installed.
Here, gpt-7 and claude-opus-6 stand for a newer model ID. Use the exact ID
from your provider's own model page.
Use a newer model. Pass its ID directly; it does not need to be in the built-in list:
What happens to an ID outside the built-in list depends on the provider:
- OpenAI. IDs from the GPT-6 generation onward (
gpt-6.2,gpt-7,gpt-8, and so on) route to OpenAI without being listed. OpenMed cannot know the exact reasoning range of an unlisted model, so it offerslow,medium, andhigh:noneis sent aslow, andxhighormaxis sent ashigh. Its context window is also unknown, so automatic compaction is off for that model; use/compactin long sessions. If ChatGPT sign-in is configured too, OpenMed tries it first; useopenmed agent --provider openaifor your API key. - Older OpenAI families. GPT-5.x (except an explicit
gpt-5.5), GPT-4,chatgpt-*, and o-series IDs are rejected before any request is sent, unless you add the ID to your model list below. - Anthropic. Any
claude-*ID routes to Anthropic. An ID that contains a family OpenMed knows, such as theopus-5inclaude-opus-5-6, gets that family's thinking behaviour. Any other Claude ID runs without extended-thinking parameters, so the reasoning setting has no effect on it, and compaction assumes a conservative 200,000-token window. - OpenRouter and Doubleword take any model ID, from
--modelor your model list. - Custom endpoints serve whatever model each endpoint declares.
- MiMo accepts only its four built-in IDs. Its list cannot be extended.
Add newer models to the /model picker. List them per provider. A model on
your OpenAI or Anthropic list always routes to that provider, even if its ID does
not match the rules above:
openmed config provider-set openai --models "gpt-7,gpt-7-mini"
openmed config provider-set anthropic --models "claude-opus-6"
# or, for one shell:
export OPENAI_MODELS="gpt-7,gpt-7-mini"
export ANTHROPIC_MODELS="claude-opus-6"
The lists are stored as models in ~/.openmed/provider_secrets.json:
{
"provider": {
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}",
"models": ["gpt-7", "gpt-7-mini"]
}
},
"anthropic": {
"options": {
"apiKey": "{env:ANTHROPIC_API_KEY}",
"models": ["claude-opus-6"]
}
}
}
}
An environment variable overrides the stored list for that provider. The effect of a list differs by provider:
| Provider | provider-set flag |
Environment variable | Effect |
|---|---|---|---|
| OpenAI | --models |
OPENAI_MODELS |
Adds to the built-in models |
| Anthropic | --models |
ANTHROPIC_MODELS |
Adds to the built-in models |
| OpenRouter | --models |
OPENROUTER_MODELS |
Replaces the default list; the first entry becomes the default |
| Doubleword | --models |
DOUBLEWORD_MODELS |
Replaces the built-in list; the first entry becomes the default |
| Custom | --base-url with --model, once per endpoint |
OPENMED_CUSTOM_BASE_URL with OPENMED_CUSTOM_MODEL, for one endpoint |
Each endpoint adds one model |
| MiMo | None | None | The four built-in models are fixed |
--unset-models removes a stored list. An ID outside the gpt- naming, or from
an older OpenAI family, runs without a reasoning parameter even when listed.
Save your default model. So that you do not need --model on every launch:
openmed config model-set gpt-7 --provider openai --reasoning-effort high
openmed config model-unset # back to the built-in default
This writes to ~/.openmed/settings.json:
provider and reasoning_effort are optional. A project's own
.openmed/settings.json takes precedence over the user file. --model,
--provider, and --reasoning-effort still override the saved values for a
single run, and an explicit --model is never combined with a saved provider.
When a model is retired. If a provider stops serving the selected model, OpenMed says so and tells you how to pick another one, instead of showing only the raw provider error. To move on:
- Find the replacement ID on the provider's own model page.
- Try it for one run with
openmed agent --model NEW_ID, adding--provider PROVIDERif the ID alone does not select the right one. - Save it with
openmed config model-set NEW_ID --provider PROVIDER, and add it to the picker withopenmed config provider-set PROVIDER --models "NEW_ID".
A resumed session keeps the model it was saved with; switch it with /model. On
OpenAI, ChatGPT sign-in, and Anthropic, background helper calls use a small
built-in model (gpt-6-luna and claude-haiku-4-5). If that model is
unavailable, the call is retried on your session's model, so there is nothing to
configure. On every other provider, helpers use your session's model.
If a provider retires all of its built-in models, OpenMed keeps working with any ID the rules above accept. MiMo has no such route: if Xiaomi retires its models, use another provider.
Hosted provider endpoints are fixed: OpenAI, Anthropic, OpenRouter, MiMo, and Doubleword do not take a base URL through provider-set. Use the custom provider for a server or gateway you operate.
OpenAI¶
The default provider. Two independent auth paths: an API key (recommended), or an experimental ChatGPT sign-in.
API key (recommended)¶
Or in ~/.openmed/provider_secrets.json (as one key inside the single
provider object — see Editing the file directly):
No openmed login step is required when using a key. This is the supported
OpenAI path.
Sign in with ChatGPT (experimental)¶
Experimental
ChatGPT sign-in is not an officially supported OpenAI API integration. It
can stop working without notice if OpenAI changes it. If sign-in or a
request fails, switch to an API key: openmed config provider-set openai
--api-key "sk-...", then openmed config model-set gpt-6.1-sol --provider openai
(or run openmed agent --provider openai).
Uses your ChatGPT subscription rather than API billing:
Credentials are reused until they expire. If auth status reports the token is not valid, openmed login -f refreshes the single global auth file. openmed login --no-browser prints the authorization URL instead of opening a browser, and --timeout <seconds> extends the default five-minute wait.
An interactive sign-in can only be started by openmed login — never implicitly from inside the TUI. If you sign in from another terminal while the TUI is open, your next message picks up the new credentials without a restart.
Models¶
gpt-6.1-sol (default), gpt-6-astra, gpt-6-sol, and gpt-6-luna.
Older OpenAI IDs such as gpt-5.6 are rejected; update a saved selection to one
of these IDs. gpt-5.5 is the exception: it is not in the picker, but an explicit
gpt-5.5 selection runs on the OpenAI API and needs an API key. For the picker
models, OpenMed selects ChatGPT sign-in when both it and an API key are available;
use --provider openai, or openmed config model-set MODEL --provider openai, to
use the API key.
Newer OpenAI models work too; see Default model and newer models.
GPT-6.1 Sol
uses the Responses API for agent tools, has a 1,050,000-token context window,
and supports low, medium (default), high, xhigh, and max reasoning.
It requires reasoning: an existing none setting is mapped to low.
Anthropic¶
openmed config provider-set anthropic --api-key "sk-ant-..."
# or
export ANTHROPIC_API_KEY=sk-ant-...
openmed agent --provider anthropic --model claude-sonnet-4-6
Or in ~/.openmed/provider_secrets.json (as one key inside the single
provider object — see Editing the file directly):
Anthropic has no OAuth path — an API key is the only option. Without OpenAI
credentials, a plain openmed launch uses claude-sonnet-4-6 and says so in the
session. To always use another Claude model, save it as your default:
Models¶
claude-fable-5-1, claude-opus-5-5, claude-opus-5, claude-sonnet-5, claude-opus-4-8, claude-sonnet-4-6 (the Anthropic default), and claude-haiku-5-5. Older IDs such as claude-opus-4-7 and claude-haiku-4-5 are not in the picker, but an explicit selection works for as long as Anthropic serves them. Selecting any claude-* model routes to Anthropic when Anthropic credentials are available, including models newer than this list (see Default model and newer models). Fable 5.1 and Opus 5.5 always use adaptive thinking; the other 5.x models also use adaptive thinking by default.
Prompt caching¶
Enabled by default. OpenMed marks the stable tool schema block and the system prompt as 5-minute cache breakpoints, and enables Anthropic's top-level automatic cache control for the growing conversation, so long tool runs do not resend the entire prior transcript as fresh input every turn.
| Variable | Purpose | Default |
|---|---|---|
OPENMED_ANTHROPIC_PROMPT_CACHE |
Enable caching for stable tool/system prefixes | 1 |
OPENMED_ANTHROPIC_PROMPT_CACHE_TTL |
Cache TTL — 5m or 1h |
5m |
OPENMED_ANTHROPIC_AUTOMATIC_CACHE |
Top-level automatic caching for multi-turn conversations | 1 |
Rate-limit guard¶
OpenMed also guards Claude's input-token-per-minute limits locally. Cache reads are excluded from Anthropic's rate-limit accounting, but cache writes and uncached conversation growth still count. OpenMed tracks uncached input usage, paces requests near the local budget, compacts stale history when a cache miss would make a request too large, and retries transient 429 responses using Claude's retry-after header.
| Variable | Purpose | Default |
|---|---|---|
OPENMED_ANTHROPIC_RATE_LIMIT_GUARD |
Pace and compact before ITPM limits are exceeded | 1 |
OPENMED_ANTHROPIC_ITPM_LIMIT |
Override the input-token-per-minute limit | model default |
OPENMED_ANTHROPIC_ITPM_SAFETY_RATIO |
Fraction of the limit to use before pacing | 0.85 |
OPENMED_ANTHROPIC_RATE_LIMIT_RETRIES |
Automatic retries after a 429 |
2 |
OpenRouter¶
OpenRouter gives you models beyond the OpenAI and Anthropic lists — Gemini, Kimi, GLM, Qwen, Llama and several hundred others — through one API key. It is a separate provider: OpenRouter credentials are never sent to OpenAI or Anthropic, and an OpenAI key is never sent to OpenRouter.
Choosing which models appear¶
Configure a short list rather than all several hundred. Those models appear in their own OpenRouter group in the /model picker:
openmed config provider-set openrouter \
--api-key "sk-or-..." \
--models "qwen/qwen3.8-27b,z-ai/glm-5.2,minimax/minimax-m3"
Or in ~/.openmed/provider_secrets.json directly (as one key inside the single provider object — see Editing the file directly):
{
"provider": {
"openrouter": {
"options": {
"apiKey": "sk-or-v1-...",
"models": [
"qwen/qwen3.8-27b",
"z-ai/glm-5.2",
"minimax/minimax-m3"
]
}
}
}
}
qwen/qwen3.8-27b is OpenMed's default OpenRouter model. The other IDs show the format; they are not recommendations.
OPENROUTER_MODELS (comma-separated) overrides the stored list for one session, and openmed config provider-set openrouter --unset-models removes it. With nothing configured, OpenMed uses qwen/qwen3.8-27b.
Browse what OpenRouter offers:
openmed config openrouter-models --search gemini
openmed config openrouter-models --all # include models OpenMed cannot use
openmed config openrouter-models --refresh # bypass the 24h metadata cache
OpenRouter environment variables¶
| Variable | Purpose | Default |
|---|---|---|
OPENROUTER_API_KEY |
The OpenRouter key. Required — OpenMed never falls back to another provider's key. | unset |
OPENROUTER_MODELS |
Comma-separated model ids offered in /model; overrides the stored list |
stored list, else qwen/qwen3.8-27b |
OPENMED_OPENROUTER_MODELS_TTL_SECONDS |
Lifetime of cached model metadata under ~/.openmed/cache/ |
86400 (24h) |
The OpenRouter base URL is fixed to https://openrouter.ai/api/v1. For a self-hosted or gateway server, use the custom provider.
Choosing a model¶
OpenRouter's catalog changes often, so start from the live listing rather than a fixed list:
The listing shows only models that can drive the agent, with their capabilities. For each candidate, check:
- Context window. OpenMed sends a large fixed tool schema on every turn, so long clinical sessions need far more than that overhead. See Context: the quiet killer.
- Licence and terms. Open weights do not mean open for clinical use. Read the model's licence and the hosting provider's terms.
- Data handling. Prompts reach both OpenRouter and the upstream provider that serves the model.
Check provider terms before clinical use
Terms and licences vary, and they change. Several restrict or forbid medical use; Google's Gemini API terms, for example, have prohibited use "in clinical practice, to provide medical advice". Others exclude regions, or forbid sending PHI to the provider's hosted API. Do not assume a BAA with an upstream provider covers requests routed through OpenRouter.
Free models¶
OpenRouter serves some models on a :free tier, at no charge and with daily
request limits. Use the ID exactly as the listing shows it:
openmed config openrouter-models --search :free
openmed config provider-set openrouter --api-key "sk-or-..." --models "vendor/model:free"
openmed agent --provider openrouter --model "vendor/model:free"
A long agent run makes many requests, so it reaches a daily limit much sooner than a short task, and free capacity can be less available than the paid tier of the same model. See OpenRouter's documentation for its limits. Check how a free tier handles prompts before sending anything sensitive.
Not every OpenRouter model can run the agent¶
OpenRouter hosts image generators, audio models, and chat models without tool calling. OpenMed's tools are the product, so a model that cannot call tools cannot drive it. OpenMed reads each model's capabilities from OpenRouter's model metadata and refuses an incompatible model at startup with the reason, rather than failing part-way through a case:
OpenRouter model 'vendor/image-model' cannot drive the agent: no tool-calling
support (required by the agent). Pick a text model with tool calling — see
`openmed config openrouter-models`.
Capabilities are also enforced per request:
| Capability | Behavior |
|---|---|
| Tool calling | Required. Models without it are refused at startup. |
| Text output | Required. Image-only and audio-only models are refused. |
| Image input | Scanned documents and screenshots are sent only to vision models. On a text-only model the attachment is omitted and the message says so. |
| Context window | Taken from OpenRouter metadata, so compaction triggers at the model's real limit. |
| Reasoning effort | Clamped to the levels the model advertises, so /model never sends an effort the model rejects. |
| Max output tokens | Clamped to the model's provider cap. |
The /model picker shows these as chips per model (vision · 1M ctx · reasoning), and marks a model incompatible before you select it.
Model quality is your call¶
The compatibility check shows that a model can drive OpenMed's tools, and a high rank on a public leaderboard measures tool mechanics and reasoning. Neither measures clinical calibration: a model can run the whole tool loop smoothly and still state a confident, wrong clinical fact. It can also have weaker instruction-following, worse tool discipline, or a smaller effective context than its advertised window.
Treat an OpenRouter model as unvalidated until you have evaluated it on your own cases, and treat generated codes, doses, and clinical claims as drafts that need review, whichever model produced them. Every PHI, de-identification, and finalization gate behaves identically regardless of provider.
Prompts you send — including any PHI in them — go to OpenRouter and on to whichever upstream provider serves that model. Check OpenRouter's privacy settings for how your data is handled and whether prompt logging is enabled on your account.
Doubleword¶
OpenMed supports three Doubleword inference modes with one key.
The built-in default interactive model is DeepSeek V4.1 Flash
(deepseek-ai/DeepSeek-V4.1-Flash); a configured model list uses its first entry.
Choose the mode based on when you need the
answer and whether requests depend on earlier results.
| Mode | OpenMed entry point | Suitable work |
|---|---|---|
| Real-time | openmed agent --provider doubleword (streaming TUI), or openmed responses submit request.json --service-tier priority (direct CLI) |
Interactive questions and work where latency matters; the TUI executes agent tools |
Async Responses (flex) |
openmed responses submit request.json |
Background handoffs, document extraction, dependent review steps that tolerate a delay |
| 24-hour Batch | openmed batch submit requests.jsonl |
Independent overnight chart reviews, research screening, indexing and other backlogs |
Doubleword describes flex as lower cost than real-time, and batch as lower cost
than flex. background: true changes how you collect a response; it does not
make a priority request cheaper. The 24-hour batch window is a completion window,
not a required wait. Each dependent batch stage gets its own window. See the
async,
real-time, and
batch service descriptions
and current model pricing before choosing a tier.
Doubleword credentials¶
export DOUBLEWORD_API_KEY="sk-your-doubleword-key"
# Or, instead of exporting the variable, store a per-user secret:
openmed config provider-set doubleword --api-key "sk-your-doubleword-key"
openmed config provider-show
Alternatively, put this entry in ~/.openmed/provider_secrets.json, merging it
inside the existing provider object if other providers are configured:
The top-level key is provider (singular). Replace the placeholder with your
key, or use "{env:DOUBLEWORD_API_KEY}" and export that variable. Keep the file
private (chmod 600 ~/.openmed/provider_secrets.json) and restart OpenMed after
manual edits. provider-set applies those permissions automatically.
An exported environment key takes precedence. All three modes use
https://api.doubleword.ai/v1; no base URL or OpenAI key is needed. openmed login
is unrelated.
Try all three Doubleword modes¶
After configuring your key above, try each mode below. These examples need only the installed CLI and your key, not native medical services. Each submission uses credits; the examples use synthetic text and cap each output at 4,096 tokens, including reasoning.
Paste: “A synthetic document queue has six items: four reviewed and two
awaiting review. Summarize that status in one sentence. No tools needed.”
The answer streams in the TUI. /model lets you change models; select the
Doubleword provider group.
Save this JSON object as request.json:
{
"model": "deepseek-ai/DeepSeek-V4.1-Flash",
"input": "A synthetic document queue has six items: four reviewed and two awaiting review. Summarize that status in one sentence.",
"max_output_tokens": 4096
}
openmed responses submit request.json --service-tier flex
# Replace <response-id> with the ID printed above. You can close the terminal.
openmed responses wait <response-id> --timeout 300
openmed responses results <response-id>
Submission prints a durable ID. results prints the Responses JSON object;
the answer is in its output items. If waiting times out, run wait again
with the same ID. To try on-demand priority through the CLI, submit a new
request with --service-tier priority; polling does not make it flex-priced.
Save these two lines as requests.jsonl (one complete JSON object per line):
{"custom_id":"queue-a","method":"POST","url":"/v1/chat/completions","body":{"model":"deepseek-ai/DeepSeek-V4.1-Flash","messages":[{"role":"user","content":"Synthetic queue A has six items, four reviewed. State how many await review."}],"max_tokens":4096}}
{"custom_id":"queue-b","method":"POST","url":"/v1/chat/completions","body":{"model":"deepseek-ai/DeepSeek-V4.1-Flash","messages":[{"role":"user","content":"Synthetic queue B has ten items, seven reviewed. State how many await review."}],"max_tokens":4096}}
openmed batch validate requests.jsonl # offline; no credits spent
openmed batch submit requests.jsonl
# Replace <job-id> with the ID printed above; collect later.
openmed batch wait <job-id> --timeout 300
openmed batch results <job-id> --json
results prints the paths to output.jsonl and errors.jsonl. Open those
files and match each row by custom_id; successful answers are under
response.body.choices[].message.content. Check errors and finish_reason
too. A five-minute local timeout is normal for a batch with a 24-hour window:
resume wait or results using the same ID. Never resubmit to check progress.
Use openmed responses list or openmed batch list if you lose an ID. All
three examples use the same DeepSeek model. The TUI runs the interactive agent
loop; openmed agent --provider doubleword --once "..." runs the same tools
headlessly. See CLI workflows. Direct Responses and batch
requests do not execute tools for you.
The mode guide explains when to use
each path, and batch inference covers overnight NLP/HCC
evidence review and result handling.
Doubleword models and picker configuration¶
With just a key, the picker offers these generation models in this order. Use the exact API IDs, including capitalization, in configuration and request bodies. The display names are not API aliases.
| Display name | API model ID |
|---|---|
| DeepSeek V4.1 Flash | deepseek-ai/DeepSeek-V4.1-Flash |
| GLM 5.3 Flash | zai-org/GLM-5.3-Flash |
| GLM 5.3 | zai-org/GLM-5.3 |
| DeepSeek V4 Pro 0813 | deepseek-ai/DeepSeek-V4-Pro-0813 |
| DeepSeek V4 Flash 0731 | deepseek-ai/DeepSeek-V4-Flash-0731 |
| Kimi K3 | moonshotai/kimi-k3 |
| Inkling | thinkingmachines/Inkling-NVFP4 |
| GLM 5.2 | zai-org/GLM-5.2-FP8 |
| Nemotron 3 Ultra 550B A55B | nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-NVFP4 |
| Kimi K2.6 | moonshotai/Kimi-K2.6 |
| Nemotron 3 Super 120B A12B | nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4 |
These are selectable defaults, not a quality ranking. Check Doubleword's catalog for availability and pricing. Shared real-time access can be rate limited.
Automatic compaction uses Doubleword's published serving windows for all 11 models: 1M for the DeepSeek, GLM, Kimi K3 and Inkling entries; 262K for Kimi K2.6 and both Nemotron entries. OpenMed carries these limits itself rather than reading them from the API, and applies the default 80% compaction threshold with space reserved for output. Any other model ID, including a dedicated alias, has an unknown window, so automatic compaction is off for it. See context and compaction for details.
Like OpenRouter, Doubleword accepts a models list under its provider options:
{
"provider": {
"doubleword": {
"options": {
"apiKey": "{env:DOUBLEWORD_API_KEY}",
"models": [
"deepseek-ai/DeepSeek-V4.1-Flash",
"zai-org/GLM-5.3-Flash",
"moonshotai/kimi-k3"
]
}
}
}
}
Export DOUBLEWORD_API_KEY for this example, or replace its environment
reference with a literal key. Merge the entry into an existing provider
object instead of replacing other providers. You can also update only the list
without changing the saved key:
openmed config provider-set doubleword --models "deepseek-ai/DeepSeek-V4.1-Flash,zai-org/GLM-5.3-Flash,moonshotai/kimi-k3"
openmed config provider-show
openmed --models
The list replaces the built-in picker list; its first entry is the default
for openmed agent --provider doubleword. Duplicates and blank entries are
removed while order and ID capitalization are preserved. Dedicated aliases
are accepted. Explicit --model selections still work outside the picker list.
Restart after manual edits, or reopen /model to reload provider configuration.
DOUBLEWORD_MODELS (comma-separated IDs) overrides the file list. An empty or
missing effective list falls back to the 11 built-ins. To restore the defaults:
The list controls interactive selection only. Responses JSON and batch JSONL
still require an explicit model; their request bodies are not rewritten from
the picker configuration. The models list does not select an execution tier.
Choosing the Doubleword execution mode¶
Async is selected per request, not in provider_secrets.json. Doubleword
does not read an async, service_tier, or mode setting from that file, or from
settings.json. The same stored key works for all modes:
| What you set | Where it goes |
|---|---|
| API key | DOUBLEWORD_API_KEY or provider.doubleword.options.apiKey in provider secrets |
| Model, input and output-token limit | The Responses JSON object or each batch JSONL row; --model for the TUI |
| Async flex or on-demand priority | openmed responses submit ... --service-tier flex (default) or --service-tier priority |
| Bulk processing with a 24-hour completion window | openmed batch submit requests.jsonl |
| Wait in this terminal | --wait on submission, or responses wait / batch wait later |
For example, an overnight backlog of independent, closed-encounter reviews fits a batch: gather NLP/HCC service evidence first, then ask the model to review each record. A single report or the next step of a dependent workflow can use flex when a delay is acceptable. Interactive work belongs in the real-time TUI. See when a 24-hour batch helps.
Doubleword real-time TUI¶
openmed agent --provider doubleword
openmed agent --provider doubleword --model deepseek-ai/DeepSeek-V4.1-Flash
# Account-specific dedicated aliases work too:
openmed agent --provider doubleword --model yourorg-zai/GLM-5.3
Open /model and select Doubleword → DeepSeek V4.1 Flash. Provider headings
remain visible while searching. This is real-time streaming, including tool
calls through OpenMed's existing agent loop. Helpers use Doubleword too.
Selecting Doubleword in the TUI does not enable flex or batch processing.
The TUI has no async mode toggle or Responses/batch job screen; use the CLI
commands below for those modes.
Interactive sessions use the model's default reasoning behavior;
--reasoning-effort does not override it. For explicit model-supported effort
settings, use reasoning.effort in a Responses request below.
Always pass --provider doubleword for an explicit model when several provider
keys are configured: a namespaced model ID alone can otherwise select OpenRouter.
The built-in or configured picker is a starting point; --model accepts other
generation models and dedicated aliases your account can serve. Model capabilities and tier
availability vary. Embedding models cannot run the interactive agent.
Doubleword describes its shared self-serve real-time endpoint as intended for development and testing, and rate limits it. Production real-time capacity is arranged separately with Doubleword; dedicated deployments use their assigned model aliases on the same API. See dedicated real-time.
Doubleword async and on-demand CLI¶
Save this JSON object, not JSONL, as request.json:
{
"model": "deepseek-ai/DeepSeek-V4.1-Flash",
"input": "Synthetic review backlog: four records have supporting evidence and two have conflicting mappings. Write a short handoff preserving the unresolved items for human review. Do not invent diagnoses or calculate risk scores.",
"max_output_tokens": 4096
}
# Async flex: return local and remote IDs once Doubleword accepts the request.
openmed responses submit request.json --service-tier flex
# Read status or resume from another terminal, even after restarting OpenMed.
openmed responses list
openmed responses status <response-id>
openmed responses wait <response-id> --timeout 300
openmed responses results <response-id>
# On-demand priority: same lifecycle, different price/latency tier.
openmed responses submit request.json --service-tier priority --wait --timeout 120
Replace <response-id> with the local or remote ID printed by submit or list.
Omitting --service-tier selects flex.
What happens after submission:
- OpenMed saves the request locally and sends one
POST /v1/responsesto Doubleword withservice_tier: "flex",background: true, andstream: false. - Doubleword returns a remote response ID and processes the work on its servers. You can close the terminal after submission; no local worker needs to stay up.
status,wait, andresultsretrieve that response withGET /v1/responses/{id}. They reuse the saved ID and do not create another paid inference request.- When complete,
resultsprints the output. It stays pending while the remote work is unfinished; failures and incomplete responses must be handled separately.
Flex is a scheduling and pricing tier. background: true lets a request return
an ID while work continues. This CLI also uses background polling for priority
requests, which still receive priority scheduling and pricing. Async flex uses
/v1/responses; bulk batches use the separate /v1/files and /v1/batches
lifecycle. Flex has no 24-hour completion window, and any scheduling target
Doubleword publishes is not a completion guarantee. See
Doubleword's async contract.
--wait controls local polling, not provider scheduling or price.
--poll-interval defaults to
five seconds and must be at least one second. Omit --timeout to keep polling;
a timeout applies to the polling loop and can overrun by one HTTP request.
Use --json for machine-readable status. results always prints the complete
Responses object, including output items, tool calls, usage, errors and
incomplete_details. A terminal incomplete response is not a successful
answer, even if it contains partial text. Exit codes are 0 for success/status,
1 for terminal failure or incomplete results, 2 for errors, 3 for a local
wait timeout, and 130 for interruption.
Closing the terminal or pressing Ctrl-C does not cancel remote work. Resume the
saved ID; do not submit the same request again to check progress. If a creation
request loses its connection, the local state is submission_unknown (or
submitting after a hard interruption). Inspect Doubleword's Responses dashboard
and attach the existing remote ID with:
There is no Responses cancellation command. Batch cancellation is available
through openmed batch cancel. An HTTP 402/403/429 indicates a
credits, access, or rate-limit issue; automatic paid retries are disabled.
Doubleword structured input and dependent steps¶
Responses request JSON passes through instructions, message-array input,
previous_response_id, tools, tool_choice, text.format, reasoning, and
other provider-supported fields. submit requires a positive integer
max_output_tokens, and rejects stream: true, background: false, and
store: false. The default model may consume part of the output budget for
reasoning. Use only the
reasoning levels your model supports.
Direct Responses and Batch commands do not execute OpenMed tools. If output
contains a function_call, your orchestrator must execute the tool, then submit
its result in the next request. A completed inference response is not evidence
that the whole workflow finished. For automatic interactive tool execution,
use the TUI, or headless --once for scripts. For overnight NLP/HCC work, prepare independent service evidence
first, then submit one batch of model reviews; see the
retrospective backlog example.
Model-supported image input, structured output and tool definitions can be included in request JSON. OpenMed has no direct embeddings command: use an embedding model through embedding batches, or call Doubleword's embeddings API from your own client.
Doubleword storage and data boundary¶
Individual Responses snapshots, submitted request bodies and collected output
are stored with owner-only permissions under ~/.openmed/responses/. Override
with OPENMED_RESPONSES_DIR or relocate the whole home with OPENMED_HOME.
status --no-refresh, results --no-refresh, and list work offline.
Batch files remain under ~/.openmed/batches/; TUI sessions use normal session
storage. Credentials are not written into job snapshots.
These are hosted inference calls. Direct JSON/JSONL input is sent as supplied
and is not transformed by the TUI's PHI setting. Review your inputs and the
provider's storage policies before submitting sensitive material. Background
Responses retain state remotely for retrieval; store:false is rejected by
the resumable CLI. Local deletion does not delete provider-side data.
Xiaomi MiMo token plan¶
For a Xiaomi MiMo token-plan subscription, store your key once. The commands below use a placeholder; replace it with your own tp key:
Or export the key for the current shell:
Neither method requires openmed login. An exported MIMO_API_KEY takes
precedence over the stored key. If MiMo is your only configured provider,
openmed also selects the default MiMo model.
Only the API key is required. All four models are preconfigured in Ctrl+M / /model:
mimo-v2.5-pro— default; text input.mimo-v2.5— text and image input.mimo-v2.6-pro— text and image input.mimo-v2.6-flash— text input.
Select a model at launch with:
openmed agent --provider mimo --model mimo-v2.6-pro
openmed agent --provider mimo --model mimo-v2.6-flash
Keys starting with tp use https://token-plan-ams.xiaomimimo.com/v1.
This provider supports token-plan subscriptions only. Pay-as-you-go
keys starting with sk are rejected with an explanatory message; they are never
sent to the token-plan endpoint. No base URL or model list needs to be configured.
MiMo provider secrets example¶
For a MiMo-only setup, the complete ~/.openmed/provider_secrets.json file is:
Replace tp-... with your token-plan key. If the file already contains other
providers, add only the mimo entry inside its existing provider object;
keep the other entries. The combined example
shows all providers together. Do not add a second top-level JSON object.
To keep the actual key in the environment, use this alternative complete file:
Export MIMO_API_KEY before launching OpenMed. A reference resolves only when
that variable is set in the OpenMed process. When editing the file manually,
keep its permissions private (chmod 600 ~/.openmed/provider_secrets.json)
and restart OpenMed to reload it. provider-set applies those permissions
automatically. Keys belong in this per-user file or the environment, never
in project settings or a repository.
MiMo configuration reference¶
| Setting | Behavior |
|---|---|
| Provider ID | mimo |
| Environment variable | MIMO_API_KEY; overrides the stored key |
| Stored key | provider.mimo.options.apiKey |
| Key type | Starts with tp; sk pay-as-you-go keys are unsupported |
| Base URL | https://token-plan-ams.xiaomimimo.com/v1; selected automatically |
| Default model | mimo-v2.5-pro |
| Built-in models | mimo-v2.5-pro, mimo-v2.5, mimo-v2.6-pro, mimo-v2.6-flash |
| Model list | Built in and fixed; --models is not accepted |
| Context window | 1M for the V2.5 models. Unknown for the V2.6 models, so automatic compaction is off for them; use /compact in long sessions |
| Transport | Streaming OpenAI-compatible Chat Completions |
| Inference boundary | Hosted by Xiaomi; the token plan is not local or offline inference |
Thinking and attachments¶
Thinking is enabled by default. Choose Thinking off in the reasoning picker,
or pass --reasoning-effort none, to disable it. Other effort values enable
thinking without selecting a strength. OpenMed preserves the provider's returned
reasoning_content across tool calls and follow-up turns as required by
MiMo's conversation protocol.
Workflow helper calls use the same token-plan key and selected model, with thinking
disabled for their short outputs. OpenMed forwards images to mimo-v2.5 and
mimo-v2.6-pro. Images attached with the other MiMo models are omitted with a
notice.
openmed agent --provider mimo --reasoning-effort none # thinking off
openmed agent --provider mimo --reasoning-effort medium # thinking on
Startup latency and TUI status¶
The direct token-plan route and OpenRouter's namespaced MiMo route are separate services. They use different credentials, endpoints, and serving infrastructure, so their time to first output can differ substantially even for the same model family. Fast generation after output begins does not imply a fast first token.
The TUI distinguishes the stages:
| Status | Meaning |
|---|---|
| Preparing request… | OpenMed is applying request/privacy routing and may run a short same-provider workflow-intent helper call. The primary model stream has not started yet. |
| Waiting for model response… | The primary request has been dispatched, but OpenMed has not received a non-empty reasoning or answer delta. |
| Model is reasoning… | The provider has emitted reasoning_content; OpenMed is rendering it live. |
Choosing --reasoning-effort none disables MiMo's generated thinking, but it
does not control provider queueing, connection setup, or time to first output.
If Preparing request… is slow, the delay is before the primary stream. If
Waiting for model response… is slow, the request has reached the provider
path and OpenMed is waiting for model output. OpenMed forwards the first
non-empty reasoning_content or answer delta to the TUI as soon as it arrives.
Verify, replace, or remove the key¶
openmed config provider-show
openmed --models
openmed config provider-set mimo --api-key "tp-..." # replace the stored key
openmed config provider-set mimo --unset-api-key # remove the stored key
provider-show reports set without printing the key. After removing a stored
key, an exported MIMO_API_KEY still takes precedence; use unset MIMO_API_KEY
to remove it from the current shell too.
| Symptom | What to check |
|---|---|
| MiMo asks for a key | Set MIMO_API_KEY or store provider.mimo.options.apiKey; check provider-show for malformed JSON or an unresolved environment reference. |
| Pay-as-you-go key rejected | Use the tp key from your token-plan subscription. sk keys are not supported by this provider. |
| Unsupported model | Use mimo-v2.5-pro, mimo-v2.5, mimo-v2.6-pro, or mimo-v2.6-flash. Namespaced xiaomi/... IDs belong to the separate OpenRouter route. |
| Slow before reasoning appears | Check the current TUI status. Preparing request… is pre-stream work; Waiting for model response… means the primary request was dispatched but the provider has not emitted model output. Compare the direct token-plan route with OpenRouter only as separate serving paths. |
--base-url or --models rejected |
MiMo's endpoint and model list are built in. Configure only the key, then select a model with --model at launch. |
| Replacing the stored key has no effect | Check whether MIMO_API_KEY is still exported, then restart OpenMed. |
Custom OpenAI-compatible endpoints¶
The custom provider points OpenMed at servers you operate — vLLM,
SGLang, llama.cpp, Ollama, LM Studio, or a company gateway. Serving engines
launch one model per endpoint, so the configuration is a list of
endpoints, each with its own base URL, optional credential, and the one model
it serves. Selecting a model routes the session to the endpoint that declares
it. The hosted providers (OpenAI, Anthropic, OpenRouter, MiMo, Doubleword)
deliberately have no base-URL configuration — a provider means one thing, and any stored
base URL for them is ignored and stripped.
Add one endpoint per model:
openmed config provider-set custom --base-url http://localhost:8000/v1 --model "nvidia/Nemotron-3-Super-120B"
openmed config provider-set custom --base-url https://gpu2.example.org/v1 --model "Qwen/Qwen3-235B-A22B" --api-key sk-host2
openmed config provider-set custom --base-url http://192.168.1.40:8000/v1 --model "poolside/Laguna"
openmed config endpoint-doctor http://localhost:8000/v1 # validate each FIRST
openmed agent --provider custom --model "poolside/Laguna"
--base-url and --model go together, because one endpoint serves one model.
Re-running with the same --model updates that endpoint (a stored key is
kept unless you pass a new one); --remove-model <id> deletes it. With no
--model, openmed agent --provider custom uses the first endpoint. A plain
openmed launch uses it when no other provider is configured; to use a specific
model every time, save it with openmed config model-set "poolside/Laguna" --provider custom.
Or in ~/.openmed/provider_secrets.json directly — an endpoints list under
the custom section:
{
"provider": {
"custom": {
"options": {
"endpoints": [
{"baseURL": "http://localhost:8000/v1", "model": "nvidia/Nemotron-3-Super-120B"},
{"baseURL": "https://gpu2.example.org/v1", "model": "Qwen/Qwen3-235B-A22B", "apiKey": "{env:HOST2_KEY}"},
{"baseURL": "http://192.168.1.40:8000/v1", "model": "poolside/Laguna"}
]
}
}
}
}
apiKey is optional per endpoint (local servers are commonly keyless) and
supports literal or {env:VAR} forms. The same one-object-one-provider-map
rule from Editing the file directly applies.
For a quick test without touching the file, environment variables declare one
additional endpoint: OPENMED_CUSTOM_BASE_URL, OPENMED_CUSTOM_MODEL, and
optionally OPENMED_CUSTOM_API_KEY. They win over a stored endpoint that
declares the same model.
What the provider does for you at startup:
- Routes by model. Each session talks only to the endpoint declaring its
model, with that endpoint's own credential — keys never cross hosts, and
your
OPENAI_API_KEYcan never silently travel to your own server. - Consults the endpoint's
/modelslisting. A model the server does not actually serve fails immediately, naming what it does serve. - Reads the served context window (vLLM/SGLang
max_model_len) for automatic compaction. A server that reports none pins the window to unknown — automatic compaction is off for that session (see Context And Compaction) and a hosted catalog namesake can never supply a fabricated number. - Sends the safe request shape. Chat Completions only,
temperatureomitted, streamed usage requested, and the runtime guard refuses a turn whose "text" is really an unparsed tool call. - Refuses cleartext keys to remote hosts — plain
http://with a stored key is allowed only for localhost and private networks, enforced both in the CLI and again at resolution so a hand-edited file cannot bypass it.
Configured models appear as a Custom endpoint group in the /model
picker, each row naming the host that serves it.
What custom models are not
OpenMed cannot vouch for the model you serve. Tool-calling discipline,
clinical quality and safety behaviour are yours to validate —
endpoint-doctor proves the plumbing, not the medicine. Check your
engine's documentation for the exact --tool-call-parser value: a wrong
one fails silently.
Checking an endpoint before you trust it¶
openmed config endpoint-doctor tells you whether an OpenAI-compatible server —
your own vLLM, SGLang, llama.cpp or Ollama, or a gateway — can actually drive the
agent. It changes nothing in your configuration. It does send a few real chat
requests, including one the size of a full OpenMed turn, so a metered endpoint
may bill them.
A healthy endpoint:
Endpoint: http://localhost:8000/v1
Model: openmed-local
[PASS] reachable: Connected to http://localhost:8000/v1.
[PASS] auth: Credentials accepted.
[PASS] models: 1 model(s) served: openmed-local
[PASS] context: Context window 65,536 tokens.
[PASS] streaming: Server streamed a response (SSE).
[PASS] tools: Model emitted a streamed tool call.
[PASS] tool_call_index: Tool-call deltas carry `index`.
[PASS] temperature: Model accepts `temperature`.
[PASS] truncation: Front of the prompt survived — no silent truncation.
Result: usable by OpenMed (2.4s)
Exit codes are 0 usable, 1 not usable, 2 bad input — so it works in CI.
An endpoint is usable when nothing failed and the reachable, models, context,
streaming and tools checks all ran; a warning does not block it.
| Flag | Purpose | Default |
|---|---|---|
--model |
Model to test | First model the endpoint serves |
--api-key |
Key for the endpoint. Prefer OPENMED_ENDPOINT_API_KEY |
OPENMED_ENDPOINT_API_KEY, then OPENROUTER_API_KEY for an OpenRouter URL |
--quick |
Send one tool instead of OpenMed's full tool schema. Faster, but it will not surface large-tool-array failures | Off |
--timeout |
Per-request timeout in seconds | 30 |
--json |
Emit the same report as JSON | Off |
The doctor does not read keys stored with provider-set. For an endpoint that
needs a key, set OPENMED_ENDPOINT_API_KEY before running it.
What it checks, and why¶
| Check | Catches |
|---|---|
reachable |
Wrong port, wrong scheme, DNS typo, TLS mismatch — each reported distinctly |
auth |
Missing or wrong API key (self-hosted servers 401; public catalogs do not) |
models |
Server up but serving nothing, or a listing that is not OpenAI-shaped |
model |
A --model the server does not serve |
context |
A window too small for OpenMed's fixed per-turn overhead, or a server that reports no window |
streaming |
Gateways that buffer and break SSE — OpenMed only streams |
tools |
Tool calling disabled, unsupported, or rejected with OpenMed's full tool array |
leaked_tool_call |
The safety check — a wrong tool-call parser returning tool syntax as prose |
leaked_reasoning |
A warning: reasoning markers such as </think> in the answer, because no reasoning parser is configured |
tool_call_index |
Streamed deltas missing index, which breaks parallel calls |
finish_reason |
Shapes the runtime rejects, which would crash on the first tool turn |
temperature |
A warning: reasoning models that reject the parameter, which OpenMed then omits |
truncation |
Servers that silently drop the front of a long prompt, where the system prompt and tool schemas sit |
The failure that matters most¶
If the server's tool-call parser is missing or wrong, it returns the tool call as
plain text with tool_calls empty and finish_reason: "stop". There is no
error, and in a clinical agent that text is indistinguishable from real content.
The doctor fails the endpoint and names the fix:
[FAIL] leaked_tool_call: The model returned tool syntax as PLAIN TEXT
(XML <tool_call> (Qwen 3.5+, GLM, MiniMax)) with no tool_calls
(finish_reason='stop'). The server is not parsing tool calls.
-> The tool-call parser is missing or wrong. vLLM needs BOTH
-> --enable-auto-tool-choice AND --tool-call-parser <name> (there is no
-> 'auto'); SGLang needs --tool-call-parser. Use the value for this model
-> family — e.g. Qwen 3.5+ is `qwen3_coder`, NOT `hermes`; GLM is `glm47`;
-> Gemma 4 is `gemma4`; MiniMax is `minimax_m3` on vLLM but `minimax-m3` on
-> SGLang. See the providers guide:
-> https://agent.openmed.life/docs/providers/
It also catches the harder version of this, where a parser matches the first tool call and leaks the rest as text — the case that otherwise looks healthy.
Context: the quiet killer¶
OpenMed sends about 95 tool schemas (about 23,000 tokens) plus its system prompt on every turn. A window below that truncates every request:
[FAIL] context: Context window is 16,384 tokens; OpenMed's tool schema alone
is 23,167. Every request would be truncated.
-> Raise the served context to at least 65,536: vLLM --max-model-len 65536,
-> SGLang --context-length 65536, llama.cpp --ctx-size 65536 (its default is
-> 4096), Ollama OLLAMA_CONTEXT_LENGTH=65536 before `ollama serve` (its
-> default auto-scales and can land at 4k — verify with `ollama ps`).
The check fails below about 43,000 tokens (the tool schema plus 20,000 tokens of working room), warns below 65,536, and passes at 65,536 or above.
It also fails when the server reports no window at all. vLLM and SGLang report one
on /v1/models; llama.cpp and Ollama may not. OpenMed can still run such a server,
with automatic compaction off and a one-time notice in the TUI, but only the
server's own settings protect you from truncation, so confirm its served context
yourself.
Serving your own model¶
Each model family needs its own launch flags, including the exact
--tool-call-parser value:
| Model family | --tool-call-parser |
|---|---|
| Qwen 3.5 and later | qwen3_coder, not hermes |
| GLM | glm47 |
| Gemma 4 | gemma4 |
| MiniMax | minimax_m3 on vLLM, minimax-m3 on SGLang |
Parser names belong to the serving engine and can change between engine versions, so check its documentation too. For example, to serve Qwen 3.8 27B on one GPU:
vllm serve Qwen/Qwen3.8-27B \
--served-model-name openmed-local \
--enable-auto-tool-choice --tool-call-parser qwen3_coder \
--reasoning-parser qwen3 \
--max-model-len 65536 \
--host 0.0.0.0 --port 8000 --api-key sk-openmed-CHANGEME
export OPENMED_ENDPOINT_API_KEY=sk-openmed-CHANGEME
openmed config endpoint-doctor http://localhost:8000/v1
openmed config provider-set custom --base-url http://localhost:8000/v1 \
--model openmed-local --api-key sk-openmed-CHANGEME
openmed agent --provider custom
Credentials
Prefer OPENMED_ENDPOINT_API_KEY over --api-key: arguments are visible in
ps and shell history. The doctor refuses to send a key over cleartext
http:// to a non-local host, strips any user:pass@ from the URL before
printing anything, and never echoes the key into its output.
Web search¶
Web search is off by default on every provider, including OpenAI and ChatGPT OAuth. When enabled it runs client-side, so it behaves identically on Anthropic, OpenRouter, MiMo, Doubleword, or a local model. Enabling it sends search queries to a third-party vendor, so it is an explicit operator decision. See Web Search.
How a provider is selected¶
The TUI defaults to gpt-6.1-sol with medium reasoning. When multiple providers are configured, the model you select determines the provider:
- A model declared on a custom endpoint always uses that endpoint.
claude-*models use Anthropic when Anthropic credentials are available.- GPT-6.1 Sol and GPT-6 models use ChatGPT OAuth first when
~/.openmed/auth.jsonexists, then fall back to the OpenAI key. Explicit GPT-5.5 selections prefer an API key when available. - Bare
mimo-v2.5-pro,mimo-v2.5,mimo-v2.6-pro, andmimo-v2.6-flashIDs use MiMo token-plan credentials. - Namespaced model ids (
vendor/model, such asqwen/qwen3.8-27b) use OpenRouter when its key is configured. Without an OpenRouter key, a configured Doubleword key can select Doubleword for these IDs. Use--provider doublewordexplicitly to select Doubleword when both keys are present. - Selecting the Doubleword group in
/model, or passing--provider doubleword, selects its real-time adapter. Its default model isdeepseek-ai/DeepSeek-V4.1-Flash; async and batch jobs use their own CLI commands.
An ordinary launch with no --model starts from gpt-6.1-sol, which needs an OpenAI key or ChatGPT sign-in. If the selected model belongs to a provider you have no credentials for, OpenMed switches to another configured provider's default model and says so in the session, in this order:
- Anthropic:
claude-sonnet-4-6 - ChatGPT sign-in or an OpenAI key:
gpt-6.1-sol - OpenRouter: your OpenRouter default model
- MiMo:
mimo-v2.5-pro - Doubleword: the Doubleword default model
- A custom endpoint: the first configured model
With no credentials at all, the TUI says what to configure and waits. Your next message picks up credentials added from another terminal. --once never replaces a model you named and exits with an error instead.
Choose the model at launch, or at runtime with Ctrl+M or /model:
openmed agent --model gpt-6.1-sol --reasoning-effort medium
openmed agent --provider openrouter --model qwen/qwen3.8-27b
openmed agent --provider doubleword --model deepseek-ai/DeepSeek-V4.1-Flash
--provider forces a specific provider; omit it to let the model decide.
Reasoning effort¶
The picker exposes model-specific values. GPT-6.1 Sol and GPT-6 Astra offer low, medium, high, xhigh, and max; GPT-6 Sol and Luna also offer none. GPT-5.5 stops at xhigh. OpenAI models outside the built-in list offer low, medium, and high. Fable 5.1, Opus 5.5, Opus 5, Sonnet 5, Opus 4.8, and Haiku 5.5 offer low, medium, high, xhigh, and max; Sonnet 4.6 offers low, medium, high, and max. extra_high is accepted as a compatibility alias: it resolves to xhigh on OpenAI models and max on Claude models.
MiMo treats none as thinking off and any other value as thinking on. Doubleword interactive sessions ignore the setting and use the model's default. openmed --models explains each mode.
For OpenRouter models the effort is clamped to the levels that model actually advertises, so a selection is never rejected by the provider.
Provider keys vs native medical services
OpenAI, Anthropic, OpenRouter, MiMo, and Doubleword keys are model-provider credentials. OpenMed's native medical services — extraction, PII, de-identification, terminology, coding — are a separate service plane with their own configuration. See Native Medical Services.