Skip to content

Models

Models define which AI provider and configuration to use for prompts.

model myModel = {
name: "claude-sonnet-4-20250514",
apiKey: env("ANTHROPIC_API_KEY"),
provider: "anthropic"
}
FieldTypeDescription
nametextModel identifier (e.g., “claude-sonnet-4-20250514”, “gpt-5.2”)
apiKeytextAPI key for authentication
providertextProvider type: "anthropic", "openai", "google"
FieldTypeDescription
urltextCustom API endpoint URL (defaults per provider)
maxRetriesOnErrornumberAutomatic retry count on API errors (default: 0)
thinkingLeveltextExtended reasoning level for supported models
toolsarrayTools available to this model
model claude = {
name: "claude-sonnet-4-20250514",
provider: "anthropic",
apiKey: env("ANTHROPIC_API_KEY")
}
model gpt = {
name: "gpt-5.2",
provider: "openai",
apiKey: env("OPENAI_API_KEY")
}
model gemini = {
name: "gemini-3-flash",
provider: "google",
apiKey: env("GOOGLE_API_KEY")
}

Some models support extended reasoning with thinkingLevel:

model deepThinker = {
name: "claude-sonnet-4-20250514",
provider: "anthropic",
apiKey: env("ANTHROPIC_API_KEY"),
thinkingLevel: "high"
}

Levels: "none", "low", "medium", "high", "max"

Automatically retry on transient errors:

model resilient = {
name: "gpt-5.2",
provider: "openai",
apiKey: env("OPENAI_API_KEY"),
maxRetriesOnError: 3
}

Use a custom API endpoint (OpenAI-compatible):

model local = {
name: "llama-3",
provider: "openai",
apiKey: "not-needed",
url: "http://localhost:11434/v1"
}

Attach tools for the model to use:

import { readFile, writeFile, bash } from "system/tools"
model agent = {
name: "claude-sonnet-4-20250514",
provider: "anthropic",
apiKey: env("ANTHROPIC_API_KEY"),
tools: [readFile, writeFile, bash]
}
// Agent can now use these tools
vibe "Read the config file and update the version" agent

See Tools for more on tool definitions.

Use different models for different tasks:

model fast = {
name: "claude-haiku-4-5-20251001",
provider: "anthropic",
apiKey: env("ANTHROPIC_API_KEY")
}
model smart = {
name: "claude-opus-4-5-20251101",
provider: "anthropic",
apiKey: env("ANTHROPIC_API_KEY")
}
// Quick tasks
let classification = do "Classify this: {text}" fast
// Complex reasoning
let analysis = do "Deeply analyze this: {text}" smart

Share models across files:

config.vibe
export model claude = {
name: "claude-sonnet-4-20250514",
provider: "anthropic",
apiKey: env("ANTHROPIC_API_KEY")
}
// main.vibe
import { claude } from "./config.vibe"
let result = do "Hello" claude