Skip to content

Installation

Kova is published on crates.io as kova-sdk. Add it to a Tokio-based Rust project.

Terminal window
cargo add kova-sdk

Or 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].

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.

FlagDefaultWhat it adds
anthropicNative Anthropic provider (Messages API, prompt caching, adaptive thinking)
openaiOpenAI-compatible provider (OpenAI, Azure, vLLM, LM Studio, …) — also powers OpenAI embeddings
geminiGoogle Gemini provider
ollamaOllama provider (local models, no API key) — also powers Ollama embeddings
bedrockAWS Bedrock provider — pulls in the AWS SDK crates
toolsBuilt-in filesystem & shell tools (read_file, shell, …)
web-toolsAdds fetch_webpage + SSRF-guarded HTTP helper; implies tools
telemetryOpenTelemetry span export (OTLP / Jaeger / stdout)

See the Feature Flags reference for the full breakdown.

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"] }

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.

[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.

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.

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.