Expand description
§openheim
A fast, multi-provider LLM agent runtime written in Rust.
§Quick start
use openheim::{OpenheimClient, Result};
#[tokio::main]
async fn main() -> Result<()> {
let client = OpenheimClient::builder()
.provider("openai")
.api_key("sk-...")
.model("gpt-4o")
.build()
.await?;
let session = client.new_session().start().await?;
session.prompt("List the files in the current directory.", |_update| {}).await?;
Ok(())
}§Providers
| Provider | Value | Default model |
|---|---|---|
| OpenAI | "openai" | gpt-4o |
| Anthropic | "anthropic" | claude-sonnet-4-6 |
"gemini" | gemini-2.0-flash | |
| Compatible | any string | set via .model() |
§Configuration file
By default openheim loads ~/.openheim/config.toml. Use
OpenheimClient::from_config to load from a custom path, or set
individual fields via the builder for fully programmatic configuration.
§MCP servers
External tools are registered as MCP servers and namespaced as
{server_name}__{tool_name}. They are automatically available in every
agent session.
§Key types
OpenheimClient/OpenheimBuilder— main entry pointSessionHandle— send prompts and receive streamingSessionUpdateeventsLlmClient— implement to add a custom providerRagContext— conversation history and skill injectionError/Result— unified error type
Re-exports§
pub use config::AgentConfig;pub use config::AppConfig;pub use config::McpServerConfig;pub use config::ModelsInfo;pub use core::agent;pub use core::llm;pub use core::models;pub use error::Error;pub use error::Result;pub use llm::AnthropicClient;pub use llm::GeminiClient;pub use llm::LlmClient;pub use llm::OpenAiClient;pub use llm::OpenAiCompatibleClient;pub use rag::Conversation;pub use rag::ConversationMeta;pub use rag::HistoryManager;pub use rag::PromptBuilder;pub use rag::RagContext;pub use client::OpenheimBuilder;pub use client::OpenheimClient;pub use client::SessionBuilder;pub use client::SessionHandle;pub use models::*;
Modules§
- acp
- client
- config
- core
- error
- mcp
- rag
- Conversation history and skill injection for agent prompts.
- tools
- transport
- tui
Structs§
- AcpTool
Call - Represents a tool call that the language model has requested.
- Content
Chunk - A streamed item of content
- Session
Info - Information about a session returned by session/list
- Tool
Call Update - An update to an existing tool call.
Enums§
- Content
Block - Content blocks represent displayable information in the Agent Client Protocol.
- Session
Update - Different types of updates that can be sent during session processing.
- Tool
Call Status - Execution status of a tool call.