Models
Models define which AI provider and configuration to use for prompts.
Basic Model Declaration
Section titled “Basic Model Declaration”model myModel = { name: "claude-sonnet-4-20250514", apiKey: env("ANTHROPIC_API_KEY"), provider: "anthropic"}Configuration Fields
Section titled “Configuration Fields”Required Fields
Section titled “Required Fields”| Field | Type | Description |
|---|---|---|
name | text | Model identifier (e.g., “claude-sonnet-4-20250514”, “gpt-5.2”) |
apiKey | text | API key for authentication |
provider | text | Provider type: "anthropic", "openai", "google" |
Optional Fields
Section titled “Optional Fields”| Field | Type | Description |
|---|---|---|
url | text | Custom API endpoint URL (defaults per provider) |
maxRetriesOnError | number | Automatic retry count on API errors (default: 0) |
thinkingLevel | text | Extended reasoning level for supported models |
tools | array | Tools available to this model |
Providers
Section titled “Providers”Anthropic
Section titled “Anthropic”model claude = { name: "claude-sonnet-4-20250514", provider: "anthropic", apiKey: env("ANTHROPIC_API_KEY")}OpenAI
Section titled “OpenAI”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")}Extended Thinking
Section titled “Extended Thinking”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"
Error Handling
Section titled “Error Handling”Automatically retry on transient errors:
model resilient = { name: "gpt-5.2", provider: "openai", apiKey: env("OPENAI_API_KEY"), maxRetriesOnError: 3}Custom Endpoints
Section titled “Custom Endpoints”Use a custom API endpoint (OpenAI-compatible):
model local = { name: "llama-3", provider: "openai", apiKey: "not-needed", url: "http://localhost:11434/v1"}Models with Tools
Section titled “Models with Tools”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 toolsvibe "Read the config file and update the version" agentSee Tools for more on tool definitions.
Multiple Models
Section titled “Multiple Models”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 taskslet classification = do "Classify this: {text}" fast
// Complex reasoninglet analysis = do "Deeply analyze this: {text}" smartExporting Models
Section titled “Exporting Models”Share models across files:
export model claude = { name: "claude-sonnet-4-20250514", provider: "anthropic", apiKey: env("ANTHROPIC_API_KEY")}
// main.vibeimport { claude } from "./config.vibe"let result = do "Hello" claude