vtcode-llm

June 17, 2026 · View on GitHub

LLM provider abstraction, client implementations, and streaming for VT Code.

Overview

Provides a unified interface for multiple LLM providers with streaming, tool calling, and provider-specific adaptations. This is a partial extraction from vtcode-core; integration-point files remain there.

Key Modules

ModulePurpose
providers/Per-provider implementations (gemini, openai, anthropic, deepseek, ollama, etc.)
provider/Core trait (LLMProvider), message types, request/response
factory_types.rsProviderConfig struct, infer_provider_from_model
system_prompt.rsSystem prompt injection via OnceLock callbacks
http_client.rsHttpClientFactory with timeout configuration
lightweight_routing.rsModel routing for lightweight/fast inference
model_resolver.rsModel name resolution and provider detection
tool_bridge.rsTool execution correlation and intent tracking
rig_adapter.rsRig-core adapter for structured output
capabilities.rsProvider capability detection

Supported Providers

ProviderModuleKey Models
Google Geminiproviders/gemini/Gemini 3.1 Pro, Gemini 3.5 Flash
OpenAIproviders/openai/GPT-5.4, GPT-5.5, GPT-5.3 Codex
Anthropicproviders/anthropic/Claude Opus 4.8, Claude Sonnet 4.6
DeepSeekproviders/deepseek.rsDeepSeek V4 Pro, V4 Flash
Z.AIproviders/zai.rsGLM-5.2, GLM-5.1, GLM-4.7
Moonshotproviders/moonshot.rsKimi K2.7 Code, K2.6, K2.5
StepFunproviders/stepfun.rsStep-3.7-Flash
MiniMaxproviders/minimax.rsMiniMax-M3, M2.7, M2.5
Ollamaproviders/ollama/Local and cloud models
OpenRouterproviders/openrouter/Marketplace models
Evolinkproviders/evolink.rsMulti-model gateway
HuggingFaceproviders/huggingface.rsRouter-based models
Mistralproviders/mistral.rsMistral models
Qwenproviders/qwen.rsQwen models
MiMoproviders/mimo.rsMiMo V2.5, V2.5 Pro

Architecture Notes

  • ProviderConfig is defined here AND in vtcode-core (identical fields) — will merge when CGP integration is decoupled
  • system_prompt.rs provides stub getters with OnceLock setters; vtcode-core overrides at init
  • Provider trait uses feature gates: #[cfg(feature = "copilot")], #[cfg(feature = "anthropic-api")]

Dependencies

  • vtcode-commons — HTTP, CGP, error types, model families, CompactStr
  • vtcode-config — provider config, timeouts, auth
  • vtcode-utility-tool-specs — apply_patch schemas

Coding Conventions

  • Provider implementations go in providers/<name>/mod.rs
  • Use anyhow::Result for fallible operations
  • Use tracing for logging, not println!
  • Provider-specific types stay in their provider module
  • Shared types go in types.rs or provider/

See Also

  • Provider Guides — setup and configuration
  • Model Catalog — full model listing with capabilities
  • vtcode-core/src/config/models.rs — model constants re-export