Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dallay/corvus/llms.txt

Use this file to discover all available pages before exploring further.

Corvus supports 30+ AI providers through a unified Provider trait interface, enabling seamless switching between models and vendors.

Provider Trait Interface

All providers implement the Provider trait from ~/workspace/source/clients/agent-runtime/src/providers/traits.rs:230, which defines:
pub trait Provider: Send + Sync {
    // Basic chat methods
    async fn simple_chat(&self, message: &str, model: &str, temperature: f64) -> Result<String>;
    async fn chat_with_system(&self, system_prompt: Option<&str>, message: &str, model: &str, temperature: f64) -> Result<String>;
    async fn chat_with_history(&self, messages: &[ChatMessage], model: &str, temperature: f64) -> Result<String>;
    
    // Structured chat with tool support
    async fn chat(&self, request: ChatRequest<'_>, model: &str, temperature: f64) -> Result<ChatResponse>;
    
    // Capabilities
    fn capabilities(&self) -> ProviderCapabilities;
    fn supports_native_tools(&self) -> bool;
    fn supports_streaming(&self) -> bool;
    
    // Tool conversion
    fn convert_tools(&self, tools: &[ToolSpec]) -> ToolsPayload;
    
    // Performance
    async fn warmup(&self) -> Result<()>;
}

Supported Providers

Corvus supports 30+ providers organized into several categories:

Primary Providers

Providers with custom implementations for optimal performance:
ProviderConfig NameAPI Key VariableTool SupportNotes
OpenRouteropenrouterOPENROUTER_API_KEY✅ NativeAccess to 100+ models
AnthropicanthropicANTHROPIC_API_KEY, ANTHROPIC_OAUTH_TOKEN✅ NativeClaude models with prompt caching
OpenAIopenaiOPENAI_API_KEY✅ NativeGPT-4o, o1, o3-mini
OpenAI Codexopenai-codexOAuth flow✅ NativeAuthenticated via OAuth
OllamaollamaOLLAMA_API_KEY (optional)✅ NativeLocal model hosting
Geminigemini, google, google-geminiAuto-detected✅ NativeGoogle’s Gemini models
GitHub Copilotcopilot, github-copilotGITHUB_TOKEN, GH_TOKEN✅ NativeCopilot Chat models

OpenAI-Compatible Providers

Providers using the OpenAI chat completions API format:
ProviderConfig NameAPI Key VariableBase URL
VeniceveniceVENICE_API_KEYhttps://api.venice.ai
Vercel AI Gatewayvercel, vercel-aiVERCEL_API_KEYhttps://api.vercel.ai
Cloudflare AIcloudflare, cloudflare-aiCLOUDFLARE_API_KEYhttps://gateway.ai.cloudflare.com/v1
GroqgroqGROQ_API_KEYhttps://api.groq.com/openai
MistralmistralMISTRAL_API_KEYhttps://api.mistral.ai/v1
xAI (Grok)xai, grokXAI_API_KEYhttps://api.x.ai
DeepSeekdeepseekDEEPSEEK_API_KEYhttps://api.deepseek.com
Together AItogether, together-aiTOGETHER_API_KEYhttps://api.together.xyz
Fireworks AIfireworks, fireworks-aiFIREWORKS_API_KEYhttps://api.fireworks.ai/inference/v1
PerplexityperplexityPERPLEXITY_API_KEYhttps://api.perplexity.ai
CoherecohereCOHERE_API_KEYhttps://api.cohere.com/compatibility
Amazon Bedrockbedrock, aws-bedrockAWS credentialshttps://bedrock-runtime.us-east-1.amazonaws.com
NVIDIA NIMnvidia, nvidia-nim, build.nvidia.comNVIDIA_API_KEYhttps://integrate.api.nvidia.com/v1
LM Studiolmstudio, lm-studioOptionalhttp://localhost:1234/v1

Chinese AI Providers

Providers with region-specific endpoints:
ProviderConfig NamesAPI Key VariableRegions
Moonshot (Kimi)moonshot, moonshot-cn, moonshot-intl, kimi, kimi-cn, kimi-globalMOONSHOT_API_KEYCN, International
GLM (Zhipu)glm, glm-cn, glm-global, zhipu, zhipu-cn, bigmodelGLM_API_KEYCN, Global
MiniMaxminimax, minimax-cn, minimax-intl, minimax-io, minimaxiMINIMAX_API_KEYCN, International
Qwen (DashScope)qwen, qwen-cn, qwen-intl, qwen-us, dashscope, dashscope-intl, dashscope-usDASHSCOPE_API_KEYCN, International, US
Z.AIzai, z.ai, zai-cn, zai-global, z.ai-cn, z.ai-globalZAI_API_KEYCN, Global
Qianfan (Baidu)qianfan, baiduQIANFAN_API_KEYCN

Other Providers

ProviderConfig NameAPI Key VariableBase URL
AstraiastraiASTRAI_API_KEYhttps://as-trai.com/v1
SyntheticsyntheticSYNTHETIC_API_KEYhttps://api.synthetic.com
OpenCode Zenopencode, opencode-zenOPENCODE_API_KEYhttps://opencode.ai/zen/v1

Provider Capabilities

Providers declare their capabilities through the ProviderCapabilities struct:
pub struct ProviderCapabilities {
    /// Whether the provider supports native tool calling via API primitives
    pub native_tool_calling: bool,
}
Providers with native tool calling support:
  • OpenRouter
  • Anthropic (Claude)
  • OpenAI (GPT-4o, o1, o3-mini)
  • Gemini
  • Ollama (with compatible models)
  • OpenAI-compatible providers
Providers without native tool calling automatically fall back to prompt-guided tool use with XML-style tags.

How to Switch Providers

In Configuration File

Edit ~/.config/corvus/config.toml:
[runtime]
provider = "anthropic"
model = "claude-3-5-sonnet-20241022"
temperature = 0.7

[runtime.provider_config]
api_key = "sk-ant-..."
# Or use environment variable: ANTHROPIC_API_KEY

Via Environment Variables

Set provider-specific API key:
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-proj-..."
export GROQ_API_KEY="gsk_..."
Generic fallback variables:
export CORVUS_API_KEY="your-key"
export API_KEY="your-key"

Programmatically

Using the factory function from ~/workspace/source/clients/agent-runtime/src/providers/mod.rs:382:
use corvus_runtime::providers::create_provider;

// Create provider with explicit API key
let provider = create_provider("anthropic", Some("sk-ant-..."))?;

// Create with environment variable resolution
let provider = create_provider("openai", None)?;

// With custom URL (e.g., remote Ollama)
let provider = create_provider_with_url("ollama", None, Some("http://10.0.0.5:11434"))?;

Provider Comparison

FeatureOpenRouterAnthropicOpenAIOllamaGemini
Native Tools
Streaming
Prompt CachingVia upstream✅ AutoN/A
Local Hosting
Model Access100+Claude onlyGPT onlyAny GGUFGemini only
CostVaries~$3-15/M tokens~$2.50-15/M tokensFreeFree tier
Setup ComplexityLowLowLowMediumMedium

Resilient Provider Chain

Corvus supports automatic failover with the create_resilient_provider factory from ~/workspace/source/clients/agent-runtime/src/providers/mod.rs:573:
[runtime]
provider = "anthropic"

[runtime.reliability]
fallback_providers = ["openrouter", "openai"]
provider_retries = 3
provider_backoff_ms = 1000
This creates a provider chain that:
  1. Tries primary provider (Anthropic)
  2. On failure, tries fallback providers in order
  3. Retries with exponential backoff
  4. Logs failures for observability

Model Routing

Route specific models to different providers:
[[runtime.model_routes]]
hint = "sonnet"
provider = "anthropic"
model = "claude-3-5-sonnet-20241022"

[[runtime.model_routes]]
hint = "gpt-4o"
provider = "openai"
model = "gpt-4o"

[[runtime.model_routes]]
hint = "local"
provider = "ollama"
model = "qwen2.5-coder:32b"

Best Practices

  1. Use environment variables for API keys instead of config files
  2. Enable fallback providers for production deployments
  3. Use OpenRouter for access to multiple models with one API key
  4. Use Ollama for local development and privacy-sensitive workloads
  5. Enable prompt caching (Anthropic) for long system prompts
  6. Set appropriate timeouts for slow providers (default: 120s)
  7. Call warmup() during initialization to pre-establish connections

See Also

Build docs developers (and LLMs) love