# vtcode-llm
## Key Modules
## Architecture Notes
- **Canonical home** for all provider code. Core's `llm/` is a thin re-export layer + factory/CGP.
- `system_prompt.rs` provides stub getters with `OnceLock` setters; vtcode-core overrides at init.
- Uses `compact_str::CompactString` (aliased `CompactStr` from `vtcode_core::types`) for small string fields.
## Dependencies
## Coding Conventions
Providers in `providers/<name>/mod.rs`. Use `anyhow::Result`, `tracing`, not `println!`. Provider-specific types stay local; shared go in `types.rs` or `provider/`.
## OpenAI-Compatible Providers
- `providers/openai_compat.rs` owns the shared shell: `OpenAiCompatSpec` (per-provider consts/overrides) + `OpenAiCompatCore<S>` + `impl_openai_compat_provider!`. New compat providers implement a Spec (~50-200 lines), not a full `LLMProvider`.
- Model normalization happens in `core.prepare()`, not `convert_request()` — payload tests must call `prepare` first. `stream: true` is only inserted when `request.stream` is set.
- Providers with extra protocols (evolink Anthropic path, opencode) hand-write the provider over `OpenAiCompatCore` instead of using the macro.
- Registration contract: keep the type name and 7-arg `from_config` consumed by `impl_standard_provider_constructor!` in vtcode-core.