What AI Models Does PrimeAgent Support? Complete Provider Registry Guide
PrimeAgent supports over 20 AI providers—including OpenAI, Anthropic, Google, AWS Bedrock, DeepSeek, and GitHub Copilot—through a provider-agnostic registry system defined in packages/ai/src/models.generated.ts and accessed via runtime helpers in packages/ai/src/models.ts.
PrimeAgent, developed by PrimeIntellect-ai, implements a comprehensive model registry that abstracts provider-specific implementations into a unified interface. This architecture allows the agent to invoke diverse AI models—from Claude and GPT-5 to specialized coding models—while maintaining consistent cost tracking and capability detection across all supported backends.
The Provider-Agnostic Model Registry
The foundation of PrimeAgent's multi-model support lies in its auto-generated model catalog. At build time, the system generates packages/ai/src/models.generated.ts, which enumerates every available AI model with complete metadata including pricing, context windows, and capability flags. The runtime module packages/ai/src/models.ts imports this registry and exposes type-safe accessors for resolving models during agent execution.
This separation between generated data and runtime logic ensures that adding support for new AI models requires only regenerating the catalog, without modifying the core agent codebase.
Supported AI Providers
The KnownProvider type in packages/ai/src/types.ts (lines 19-51) defines the complete enumeration of supported backends. PrimeAgent categorizes these into several families:
Major Cloud Providers:
amazon-bedrock– AWS Bedrock models (Claude, Llama, Mistral, MiniMax)anthropic– Direct Anthropic API accessgoogle/google-vertex– Google Generative AI and Vertex AI platformsopenai/openai-codex– OpenAI chat completions and Codex models
Specialized Inference Platforms:
prime-inference– Prime Agent's proprietary inference gatewaydeepseek– DeepSeek model familygithub-copilot– GitHub Copilot integrationmistral,minimax,moonshotai– Specialized model providers
Third-Party Gateways:
xai,groq,cerebras,openrouter,vercel-ai-gateway,zaihuggingface,fireworks,opencode,kimi-codingcloudflare-workers-ai,xiaomi*
The registry supports extensibility; new providers can be added by updating the type definitions and regenerating models.generated.ts.
Model Metadata and Capabilities
Each model in the registry conforms to the Model<Api> interface, containing rich metadata that enables runtime capability detection and cost optimization. Key fields include:
id– Unique identifier (e.g.,anthropic.claude-opus-4-7)name– Human-readable model designationapi– Low-level API implementation (bedrock-converse-stream,openai-completions, etc.)provider– Owning provider from theKnownProviderenumerationbaseUrl– Custom endpoint URL when applicablereasoning– Boolean flag indicating chain-of-thought and tool usage supportthinkingLevelMap– Optional mapping of supported reasoning intensities (off,minimal,low,medium,high,xhigh,max)input– Accepted input modalities (text,image)cost– Per-token pricing structure (input, output, cache read/write in USD × 10⁶)contextWindow– Maximum retained context tokensmaxTokens– Maximum generation length
The models.generated.ts file contains complete entries for Bedrock-hosted models (Claude, Llama, Mistral, MiniMax), OpenAI-style models (GPT-5.x series), Google Gemini variants, NVIDIA Nemotron, and numerous specialized coding models.
Runtime API for Model Access
PrimeAgent exposes three primary helpers in packages/ai/src/models.ts (lines 4-38) for runtime model resolution:
getModel – Retrieves a specific model by provider and ID with full type safety:
export function getModel<TProvider extends KnownProvider, TModelId extends keyof (typeof MODELS)[TProvider]>(
provider: TProvider,
modelId: TModelId,
): Model<ModelApi<TProvider, TModelId>>;
getProviders – Returns the complete list of available providers:
export function getProviders(): KnownProvider[];
getModels – Lists all models for a specific provider:
export function getModels<TProvider extends KnownProvider>(
provider: TProvider,
): Model<ModelApi<TProvider, keyof (typeof MODELS)[TProvider]>>[];
These functions enforce compile-time validation of provider-model combinations while enabling the coding agent to resolve user selections, validate capabilities, and compute usage costs dynamically.
Working with the Model Registry
The following examples demonstrate common operations against the PrimeAgent model system.
Listing all available providers:
import { getProviders } from '@/ai/src/models';
const providers = getProviders();
console.log('Supported providers:', providers);
Enumerating models for a specific provider:
import { getModels } from '@/ai/src/models';
const bedrockModels = getModels('amazon-bedrock');
bedrockModels.forEach(m => {
console.log(`${m.id} – ${m.name} (reasoning=${m.reasoning})`);
});
Inspecting model capabilities:
import { getModel } from '@/ai/src/models';
const model = getModel('amazon-bedrock', 'anthropic.claude-opus-4-7');
console.log('Model name:', model.name);
console.log('Supported thinking levels:', model.thinkingLevelMap);
console.log('Input modalities:', model.input);
Calculating generation costs:
import { calculateCost, getModel } from '@/ai/src/models';
import type { Usage } from '@/ai/src/types';
const model = getModel('openai', 'gpt-5.5');
const usage: Usage = {
input: 500,
output: 1000,
cacheRead: 0,
cacheWrite: 0,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
};
calculateCost(model, usage);
console.log('Estimated cost (USD):', usage.cost.total);
Summary
- PrimeAgent supports over 20 AI providers through a unified registry system defined in
packages/ai/src/types.tsandpackages/ai/src/models.generated.ts. - The
KnownProvidertype includes major platforms (OpenAI, Anthropic, Google, AWS Bedrock) alongside specialized gateways (Groq, Cerebras, DeepSeek, GitHub Copilot). - Each model entry contains comprehensive metadata including pricing, context windows, reasoning capabilities, and supported input modalities.
- Runtime access is provided through type-safe helpers (
getModel,getProviders,getModels) implemented inpackages/ai/src/models.ts. - The build-time generation strategy allows seamless extension of the model catalog without modifying core agent logic.
Frequently Asked Questions
Which providers does PrimeAgent support out of the box?
PrimeAgent includes native support for over 20 providers defined in the KnownProvider type within packages/ai/src/types.ts. This encompasses major cloud AI platforms (OpenAI, Anthropic, Google Vertex AI, AWS Bedrock), specialized inference services (DeepSeek, Mistral, MiniMax, Moonshot AI), and third-party gateways (Groq, Cerebras, OpenRouter, Vercel AI Gateway). The registry also supports GitHub Copilot and Prime Agent's own prime-inference gateway.
How does PrimeAgent handle model capabilities like reasoning and thinking levels?
Each model entry in the generated registry includes a reasoning boolean flag and an optional thinkingLevelMap property that defines supported reasoning intensities ranging from off to max. These metadata fields enable the agent to automatically adjust prompting strategies and tool usage based on the selected model's cognitive capabilities, as defined in the Model<Api> interface.
Can I add custom models or providers to PrimeAgent?
Yes. The registry architecture allows extension by adding new entries to the provider definitions in packages/ai/src/types.ts and regenerating packages/ai/src/models.generated.ts. This build-time generation approach ensures that custom providers integrate seamlessly with existing runtime helpers like getModel() and calculateCost(), maintaining type safety across the entire codebase.
How does PrimeAgent calculate token costs across different providers?
The calculateCost function in packages/ai/src/models.ts consumes model-specific pricing data from the registry's cost field, which stores per-token rates for input, output, and cache operations (in USD × 10⁶). By passing a Usage object containing token counts to calculateCost(), the system computes accurate cost estimates regardless of the underlying provider's pricing structure.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →