Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
vtcode-core
Core library for VT Code — a Rust-based terminal coding agent.
vtcode-core powers the VT Code agent runtime. It provides the
reusable building blocks for multi-provider LLM orchestration, tool
execution, semantic code analysis, and configurable safety policies.
Highlights
- Provider Abstraction — unified LLM interface with adapters for OpenAI, Anthropic, xAI, DeepSeek, Gemini, OpenRouter, and Ollama (local), including automatic failover and spend controls.
- Prompt Caching — cross-provider caching system that leverages
provider-specific caching capabilities (OpenAI's automatic caching, Anthropic's
cache_controlblocks, Gemini's implicit/explicit caching) to reduce costs and latency, with configurable settings per provider. - Semantic Workspace Model — LLM-native code analysis and navigation across all modern programming languages.
- Bash Shell Safety —
tree-sitter-bashintegration for critical command validation and security enforcement. - Tool System — trait-driven registry for shell execution, file IO, search, and custom commands, with Tokio-powered concurrency and PTY streaming.
- Ownership-First Tool Bridging — prefer native CGP wrappers and borrowed tool references; use
Arc<dyn Tool>bridges only when tools genuinely need shared ownership. - Configuration-First — everything is driven by
vtcode.toml, with model, safety, and automation constants centralized inconfig::constantsand curated metadata indocs/models.json. - Safety & Observability — workspace boundary enforcement, command allow/deny lists, human-in-the-loop confirmation, and structured event logging for comprehensive audit trails.
vtcode-core - Runtime for VT Code
vtcode-core powers the VT Code terminal coding agent. It provides the
reusable building blocks for multi-provider LLM orchestration, tool
execution, semantic code analysis, and configurable safety policies.
Highlights
- Provider Abstraction: unified LLM interface with adapters for OpenAI, Anthropic, xAI, DeepSeek, Gemini, OpenRouter, and Ollama (local), including automatic failover and spend controls.
- Prompt Caching: cross-provider prompt caching system that leverages provider-specific caching capabilities (OpenAI's automatic caching, Anthropic's cache_control blocks, Gemini's implicit/explicit caching) to reduce costs and latency, with configurable settings per provider.
- Semantic Workspace Model: LLM-native code analysis and navigation across all modern programming languages.
- Bash Shell Safety: tree-sitter-bash integration for critical command validation and security enforcement.
- Tool System: trait-driven registry for shell execution, file IO, search, and custom commands, with Tokio-powered concurrency and PTY streaming.
- Configuration-First: everything is driven by
vtcode.toml, with model, safety, and automation constants centralized inconfig::constantsand curated metadata indocs/models.json. - Safety & Observability: workspace boundary enforcement, command allow/deny lists, human-in-the-loop confirmation, and structured event logging for comprehensive audit trails.
Architecture Overview
The crate is organized into several key modules:
config/: configuration loader, defaults, and schema validation.llm/: provider clients, request shaping, and response handling.tools/: built-in tool implementations plus registration utilities.context/: conversation management and memory.executor/: async orchestration for tool invocations and streaming output.core/prompt_caching: cross-provider prompt caching system that leverages provider-specific caching mechanisms for cost optimization and reduced latency.
Quickstart
use ;
async
Extending VT Code
Register custom tools or providers by composing the existing traits:
use ;
async
For a complete tour of modules and extension points, read
docs/ARCHITECTURE.md and the guides in docs/project/.
Agent Client Protocol (ACP)
VT Code's binary exposes an ACP bridge for Zed. Enable it via the [acp] section in
vtcode.toml, launch the vtcode acp subcommand, and register the binary under
agent_servers in Zed's settings.json. Detailed instructions and troubleshooting live in the
Zed ACP integration guide,
with a rendered summary on
docs.rs.
Bridge guarantees
- Tool exposure follows capability negotiation:
read_filestays disabled unless Zed advertisesfs.read_text_file. - Each filesystem request invokes
session/request_permission, ensuring explicit approval within the editor before data flows. - Cancellation signals propagate into VT Code, cancelling active tool calls and ending the
turn with
StopReason::Cancelled. - ACP
planentries track analysis, context gathering, and response drafting for timeline parity with Zed. - Absolute-path checks guard every
read_fileargument before forwarding it to the client. - Non-tool-capable models trigger reasoning notices and an automatic downgrade to plain completions without losing plan consistency.
VT Code Core Library
This crate provides the core functionality for the VT Code agent, including tool implementations, LLM integration, and utility functions.
Architecture Overview
| Module | Purpose |
|---|---|
config/ |
Configuration loader, defaults, schema validation |
llm/ |
Provider clients, request shaping, response handling |
tools/ |
Built-in tool implementations and registration utilities |
context/ |
Conversation management and memory |
exec/ |
Async orchestration for tool invocations and streaming output |
core/prompt_caching |
Cross-provider prompt caching system |
mcp/ |
Model Context Protocol client support |
safety/ |
Workspace boundary enforcement and command safety |
Public entrypoints
Agent/AgentRunner— main agent runtimeVTCodeConfig— configuration loader (vtcode.toml+ environment overrides)ToolRegistry/OptimizedToolRegistry— tool registration and executionAnyClient/make_client— provider-agnostic LLM client factoryPromptCache/PromptOptimizer— prompt caching primitivesThreadManager— thread lifecycle and event recording
Usage
use ;
async
Feature flags
| Flag | Description |
|---|---|
tui (default) |
Terminal UI via crossterm |
schema |
JSON Schema generation via schemars |
a2a-server |
Agent2Agent Protocol HTTP server |
anthropic-api |
Anthropic-compatible API server |
desktop-notifications |
Desktop notification support |
API reference
See docs.rs/vtcode-core.