Installation
Kova is published on crates.io as
kova-sdk. Add it to a Tokio-based Rust project.
Add the crate
Section titled “Add the crate”cargo add kova-sdkOr add it to Cargo.toml by hand:
[dependencies]kova-sdk = "0.9"tokio = { version = "1", features = ["macros", "rt-multi-thread"] }You need a Tokio runtime because every network call in Kova is async. The
macros and rt-multi-thread features give you #[tokio::main].
Feature flags
Section titled “Feature flags”Kova ships several optional pieces behind Cargo features so your build only compiles what you use. Providers are on by default; tools and telemetry are off.
| Flag | Default | What it adds |
|---|---|---|
anthropic | ✅ | Native Anthropic provider (Messages API, prompt caching, adaptive thinking) |
openai | ✅ | OpenAI-compatible provider (OpenAI, Azure, vLLM, LM Studio, …) — also powers OpenAI embeddings |
gemini | ✅ | Google Gemini provider |
ollama | ✅ | Ollama provider (local models, no API key) — also powers Ollama embeddings |
bedrock | ✅ | AWS Bedrock provider — pulls in the AWS SDK crates |
tools | ❌ | Built-in filesystem & shell tools (read_file, shell, …) |
web-tools | ❌ | Adds fetch_webpage + SSRF-guarded HTTP helper; implies tools |
telemetry | ❌ | OpenTelemetry span export (OTLP / Jaeger / stdout) |
See the Feature Flags reference for the full breakdown.
Only need one provider?
Section titled “Only need one provider?”The Bedrock feature pulls in the entire AWS SDK dependency tree. If you don’t use Bedrock, turn the defaults off and opt back in to just what you need — your build gets noticeably lighter:
[dependencies]kova-sdk = { version = "0.9", default-features = false, features = ["anthropic"] }Want the built-in tools?
Section titled “Want the built-in tools?”Enable tools for filesystem and shell tools, or web-tools (which implies
tools) to also get web fetching:
[dependencies]kova-sdk = { version = "0.9", features = ["web-tools"] }These are opt-in to keep the core dependency-light — the web tools pull in an HTML parser and readability-extraction stack. See Built-in Tools & ToolPolicy.
Want tracing?
Section titled “Want tracing?”[dependencies]kova-sdk = { version = "0.9", features = ["telemetry"] }Without the telemetry feature, TelemetryConfig::init() still works — it
installs a lightweight tracing_subscriber with zero OpenTelemetry overhead.
See Telemetry & Metrics.
The prelude
Section titled “The prelude”Nearly every example in these docs starts with the prelude, which re-exports the common types in one line:
use kova_sdk::prelude::*;That brings in Agent, AgentBuilder, AgentResponse, AgentEvent,
KovaError, ProviderErrorClass, the core model types (ConversationMessage,
ContentBlock, Role, StopReason, StreamEvent, ToolDefinition,
ToolResult, UsageStats, InferenceConfig, ModelResponse), LlmProvider,
RetryConfig, EmbeddingProvider, Tool, ToolRegistry, ToolLifecycleHook,
the approval types, and CancellationToken (re-exported for the cancellable
run variants). Provider structs live under kova_sdk::provider::* and are
imported explicitly.
Verify your setup
Section titled “Verify your setup”Create a throwaway binary and paste in the Quick Start. The fastest way to confirm everything compiles and runs without an API key is to point the OpenAI-compatible provider at a local server such as Ollama, LM Studio, or vLLM:
// A local OpenAI-compatible endpoint needs no API key.let config = OpenAiProviderConfig::new("http://127.0.0.1:1234", "my-model");Now head to the Quick Start.