Model Registry

The MODEL_REGISTRY is a built-in catalog of all models the relay knows how to route. Each entry includes the canonical name, provider, capabilities, and pricing.

Helpers

import { findModel, providerForModel, modelsForProvider } from 'inference-relay';

findModel(canonical)

const m = findModel('gpt-4o-mini');
// { canonical: 'gpt-4o-mini', apiId: 'gpt-4o-mini',
//   provider: 'openai-api',
//   capabilities: { streaming: true, tools: true,
//     multimodal: true, contextWindow: 128000 },
//   pricing: [0.15, 0.6] }

providerForModel(canonical)

providerForModel('claude-sonnet-4-6');  // 'anthropic-api'
providerForModel('gpt-4o');             // 'openai-api'
providerForModel('mistral');            // 'ollama'

modelsForProvider(provider)

modelsForProvider('anthropic-api');
// [{ canonical: 'claude-haiku-4-5', ... },
//  { canonical: 'claude-sonnet-4-6', ... }, ...]

Full Registry

Anthropic

ModelToolsMultimodalContextPricing (in/out)
claude-haiku-4-5YesYes200K$0.80 / $4.00
claude-sonnet-4-6YesYes200K$3.00 / $15.00
claude-opus-4-6YesYes200K$15.00 / $75.00

OpenAI

ModelToolsMultimodalContextPricing (in/out)
gpt-4.1YesYes1M$2.00 / $8.00
gpt-4.1-miniYesYes1M$0.40 / $1.60
gpt-4.1-nanoYesYes1M$0.10 / $0.40
gpt-4oYesYes128K$2.50 / $10.00
gpt-4o-miniYesYes128K$0.15 / $0.60
o4-miniYesNo200K$1.10 / $4.40
o3YesNo200K$0.40 / $1.60
o3-miniYesNo200K$1.10 / $4.40
o1NoNo200K$15.00 / $60.00

Ollama (Local)

ModelToolsMultimodalContextPricing
llama3.1YesNo128KLocal
mistralYes*No32KLocal
mistral-nemoYesNo128KLocal
llavaNoYes32KLocal
qwen2:0.5bNoNo32KLocal

*Tool support is detected at runtime. The registry capability flag is a hint — the runtime detection is authoritative. Ollama pricing is always $0.

How the Registry Is Used

  • Smart pre-skip— The FallbackEngine skips providers that don't own a model before attempting the request. See Fallback.
  • Demo dropdowns — The Electron and web demos use modelsForProvider() to populate model selection grouped by provider.
  • Cost estimationestimateCost() uses registry pricing to project request costs before execution.

Custom Models

The registry is read-only in the current release. Custom Ollama models are detected at runtime regardless of whether they appear in the registry. For API providers, pass any valid model name — the provider will forward it even if it's not in the registry.