Skip to main content

Crate llm_kernel

Crate llm_kernel 

Source
Expand description

§llm-kernel

Foundation library for Rust AI-native applications.

Provides a composable, feature-gated set of modules for building LLM-powered tools, agents, and servers:

FeatureModuleDescription
providerproviderProvider catalog, model descriptors, pricing — default
client-asyncllmAsync LLM client (OpenAI, Anthropic) with SSE streaming
discoverydiscoveryDynamic model discovery (models.dev, Ollama, OpenAI-compat)
secretssecretsSecretVault — dotenv-style credential management
storestoreSQLite init helpers (WAL, PRAGMA, schema versioning)
configconfigTOML config loader with auto-create from template
graphgraphKnowledge graph — SQLite, FTS5, smart recall, BFS traversal
mcpmcpMCP server framework — JSON-RPC 2.0, stdio transport
tokenstokensToken estimation with Unicode-script heuristics
installinstallAI tool installation wizard (Claude, Cursor, Copilot, etc.)
searchsearchHybrid search with Reciprocal Rank Fusion
embeddingembeddingEmbedding provider trait + cosine similarity
telemetrytelemetryTelemetry framework — enum-gated events, no PII
safetysafetySecret masking, error classification, output sanitization

§Quick start

The prelude module re-exports the most commonly used types:

use llm_kernel::prelude::*;

Modules§

config
TOML config loader with auto-create from template.
discovery
Dynamic model discovery from remote sources.
embedding
Embedding provider abstraction.
error
Error types and result alias for llm-kernel. Error types for llm-kernel.
graph
AI agent memory graph — SQLite-backed long-term memory with FTS5 search, smart recall, and graph-structured relevance boosting.
install
AI tool installation wizard.
llm
Async LLM client with OpenAI and Anthropic backends.
mcp
MCP (Model Context Protocol) server framework.
prelude
Re-exports of the most commonly used types.
provider
LLM provider catalog and capability profiles.
safety
Safety utilities for AI-native applications.
search
Hybrid search: BM25 + vector similarity with Reciprocal Rank Fusion.
secrets
Credential management via dotenv-style vault.
store
SQLite initialization helpers.
telemetry
Telemetry framework for Rust AI tools.
tokens
Token estimation for LLM context budgeting.

Functions§

name
Returns the crate name ("llm-kernel").
version
Returns the crate version (from Cargo.toml).