VM0VM0
Model Selection

Overview

Configure model providers for your VM0 agents

VM0 agents use model providers to connect to AI models. The model provider system securely stores your credentials and automatically injects them when running agents.

Quick Start

Configure a model provider with a single command:

vm0 model-provider setup

This interactive command will:

  1. Show available provider types
  2. Prompt for your credential (API key or OAuth token)
  3. Allow model selection (for providers that support it)
  4. Store credentials securely on the VM0 platform

Once configured, credentials are automatically injected when running agents.

Available Providers

ProviderTypeModelsHow to Get Credential
Claude (OAuth)claude-code-oauth-tokenLatest ClaudeRun claude setup-token
Claude (API)anthropic-api-keyLatest ClaudeAnthropic Console
OpenRouteropenrouter-api-keyClaude Sonnet/Opus/HaikuOpenRouter Keys
Moonshotmoonshot-api-keyKimi K2 modelsMoonshot Platform
MiniMaxminimax-api-keyMiniMax-M2.1MiniMax Platform
DeepSeekdeepseek-api-keydeepseek-chatDeepSeek Platform
Z.AIzai-api-keyGLM-4.7, GLM-4.5-AirZ.AI Platform
Azure Foundryazure-foundryCustomAzure Portal
AWS Bedrockaws-bedrockCustomAWS Console

Azure Foundry and AWS Bedrock are experimental features with multi-credential authentication.

Non-Interactive Setup

For CI/CD or scripting, provide credentials via flags:

# Simple providers (single credential)
vm0 model-provider setup --type anthropic-api-key --secret "sk-xxx"

# With model selection
vm0 model-provider setup --type openrouter-api-key --secret "sk-xxx" --model "anthropic/claude-sonnet-4.5"

Model Selection

Some providers support choosing specific models. During setup, you'll be prompted to select a model:

ProviderAvailable ModelsDefault
OpenRouteranthropic/claude-sonnet-4.5, anthropic/claude-opus-4.5, anthropic/claude-haiku-4.5auto
Moonshotkimi-k2.5, kimi-k2-thinking-turbo, kimi-k2-thinkingkimi-k2.5
Z.AIGLM-4.7, GLM-4.5-AirGLM-4.7
MiniMaxMiniMax-M2.1MiniMax-M2.1
DeepSeekdeepseek-chatdeepseek-chat
Azure FoundryCustom input-
AWS BedrockCustom input-

Managing Model Providers

# List all configured providers
vm0 model-provider list

# Set a provider as default
vm0 model-provider set-default openrouter-api-key

# Delete a provider
vm0 model-provider delete anthropic-api-key

How Credential Injection Works

When you run an agent:

  1. If your vm0.yaml has explicit auth environment variables, those are used
  2. Otherwise, your default model provider credential is injected automatically
  3. You can override at runtime with: vm0 run agent "prompt" --model-provider <type>

Runtime Override

Override your default provider for a single run:

vm0 run my-agent "build a todo app" --model-provider openrouter-api-key

Advanced: Manual Configuration

For most users, vm0 model-provider setup is the recommended approach. Manual configuration is only needed for advanced use cases.

If you need per-agent authentication overrides or custom configurations, you can set environment variables directly in your vm0.yaml:

vm0.yaml
version: "1.0"

agents:
  my-agent:
    framework: claude-code
    environment:
      ANTHROPIC_BASE_URL: "https://api.example.com/anthropic"
      ANTHROPIC_AUTH_TOKEN: "${{ secrets.MY_API_KEY }}"
      ANTHROPIC_MODEL: "model-name"

See individual provider pages for specific environment variable details.