1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
[]
= "llm-kernel"
= "0.26.1"
= "2024"
= "Foundation library for Rust AI-native apps — provider catalog, LLM client, MCP server, search, telemetry, and safety"
= "Apache-2.0"
= "https://github.com/epicsagas/llm-kernel"
= "https://github.com/epicsagas/llm-kernel"
= "1.92"
= ["llm", "ai", "mcp", "provider", "embedding"]
= ["api-bindings", "asynchronous", "science"]
= "https://docs.rs/llm-kernel"
= "README.md"
= [".github/", "target/"]
[]
= [
".",
]
[]
= "llm_kernel"
= "src/lib.rs"
[]
= ["provider"]
# Core provider catalog (ProviderIndex, ServiceDescriptor, catalog.json)
= ["dep:serde_json"]
# Dynamic model discovery (models.dev, Ollama, OpenAI-compatible)
= ["provider", "dep:ureq"]
# Asynchronous LLM client (reqwest-based) with JSON extraction
= ["dep:reqwest", "dep:serde_json", "dep:async-trait", "dep:tokio", "dep:tokio-stream", "dep:futures-core"]
# Asynchronous model discovery (async DiscoverySource over reqwest)
= ["discovery", "dep:reqwest", "dep:async-trait", "dep:tokio"]
# Catalog sync tooling — refresh catalog.json from models.dev (sync-catalog binary)
= ["provider", "discovery", "dep:clap", "dep:anyhow"]
# LLM response cache over a KvStore (wraps any LLMClient)
= ["client-async", "store"]
# Secret vault (dotenv-style credential management)
= ["dep:tempfile", "dep:zeroize"]
# SQLite store helpers (init_schema, PRAGMA, FTS5, KvStore)
= ["dep:rusqlite"]
# TOML config loader
= ["dep:toml"]
# Knowledge graph (SQLite + FTS5 + smart recall + BFS traversal)
= ["store", "dep:serde_json"]
# CJK-aware graph search (Rust-side segmentation; no schema change)
= ["graph"]
# PostgreSQL GraphBackend (PgGraph) + SQLite<->PostgreSQL migration CLI.
# Mirrors the SQLite graph over the synchronous `postgres` driver.
= ["graph", "dep:postgres", "dep:clap"]
# TLS-enabled PgGraph connections (connect_tls / connect_native_tls) via
# postgres-native-tls — for Postgres servers requiring sslmode=require+.
= ["graph-pg", "dep:postgres-native-tls", "dep:native-tls"]
# Async PostgreSQL graph backend (SqlxPgGraph) over `sqlx::PgPool` — for
# consumers (e.g. klr) that own an async pool and need transaction sharing.
# Reuses the existing sqlx + async-trait deps (also pulled by pgvector / client-async).
= ["graph", "dep:sqlx", "dep:async-trait"]
# MCP server framework (JSON-RPC 2.0, stdio transport, async handlers)
= ["dep:serde_json", "dep:async-trait", "dep:getrandom"]
# MCP remote transport over HTTP with optional SSE (axum + tokio)
= ["mcp", "dep:axum", "dep:tokio", "dep:tokio-stream", "tokio/net", "tokio/io-util"]
# Token estimation (zero-dep heuristic)
= []
# AI tool installation wizard
= ["dep:serde_json"]
# Hybrid search — SearchProvider trait + RRF / weighted-sum / CombMNZ fusion
# over local result lists. Stays light (serde_json only): async cross-engine
# federation lives behind the dedicated `federation` feature so a `search`-only
# user compiles no async runtime.
= ["dep:serde_json"]
# Embedding provider trait + cosine similarity (+ async vector index trait)
= ["dep:async-trait"]
# TurboQuant compressed vector index (2-bit/4-bit, SIMD ANN search)
= ["embedding", "dep:turbovec", "dep:serde_json"]
# Qdrant AsyncVectorIndex (QdrantVectorIndex) for remote vector search.
= ["embedding", "dep:qdrant-client", "dep:serde_json"]
# Elasticsearch AsyncVectorIndex (ElasticsearchVectorIndex) over a hand-rolled
# reqwest client (the official `elasticsearch` crate is alpha-only). Mirrors the
# `qdrant` feature, reusing the reqwest already behind `client-async`.
= ["embedding", "dep:reqwest", "dep:serde_json"]
# pgvector AsyncVectorIndex (PgVectorIndex) over `sqlx` + the pgvector
# extension. Mirrors `qdrant`/`elastic` — an async remote vector backend.
= ["embedding", "dep:sqlx", "dep:pgvector"]
# Cross-engine search federation — concurrent query over multiple
# `AsyncVectorIndex` backends with a per-backend timeout and RRF / weighted-sum
# fusion (`FederatedSearch`). Owns the `tokio` + `futures-util` deps so `search`
# and `embedding` stay light; a single-backend `qdrant`/`elastic` user compiles
# no federation runtime.
= ["search", "embedding", "dep:tokio", "dep:futures-util"]
# OpenAI text-embedding provider (requires ureq for sync HTTP)
= ["embedding", "dep:ureq", "dep:serde_json"]
# Local ONNX embedding via fastembed-rs (downloads models from HuggingFace).
# Statically links ONNX Runtime via `fastembed/ort-download-binaries-rustls-tls`:
# ort-sys downloads + links a prebuilt static archive at build time, producing a
# self-contained binary with no runtime dylib resolution. CAVEAT (#55): ort's
# prebuilt static archive requires glibc ≥2.38 (`__isoc23_strtol` etc.) on Linux
# and a current MSVC CRT on Windows; older baselines (ubuntu 22.04, glibc 2.35)
# fail at the *release link step* (`cargo check` stays green because it does
# not link). For those, use `embedding-fastembed-dynamic-linking` instead.
= ["embedding", "dep:fastembed", "dep:indexmap", "fastembed/hf-hub-rustls-tls", "fastembed/ort-download-binaries-rustls-tls"]
# Qwen3 embedding via fastembed-rs candle backend
= ["embedding-fastembed", "fastembed/qwen3", "dep:candle-core"]
# Nomic V2 MoE embedding via fastembed-rs candle backend
= ["embedding-fastembed", "fastembed/nomic-v2-moe", "dep:candle-core"]
# DirectML GPU execution provider for FastembedProvider (Windows only)
= ["embedding-fastembed", "dep:ort"]
# CoreML GPU/ANE execution provider for FastembedProvider (macOS only) —
# mirrors directml: ort CoreML EP로 bge-m3 임베딩 가속 (CPU 대비 수십배).
= ["embedding-fastembed", "dep:ort"]
# Metal GPU acceleration for the candle-based providers (Qwen3, Nomic V2 MoE)
# on macOS. Enables candle-core's `metal` feature so `Device::new_metal()`
# routes inference to the Apple Silicon GPU. candle-core gates its Metal deps
# behind `target_os = "macos"` (same pattern ort uses for CoreML), so this
# feature is a no-op to enable on other platforms — but the constructors are
# only compiled on macOS. Combine with `embedding-fastembed-qwen3` and/or
# `embedding-fastembed-nomic-moe`.
= ["candle-core/metal"]
# Rust-native MLX embedding on Apple Silicon (GPU via unified memory).
# oxideai/mlx-rs (NOT mlxrs). macOS/aarch64 only — the target-cfg dep section
# below means mlx-rs is not fetched off macOS, so this is safe to include in
# `full` (Linux CI stays green). safetensors comes via mlx-rs's own feature.
= ["embedding", "dep:mlx-rs", "dep:tokenizers", "dep:hf-hub", "dep:safetensors", "dep:serde_json", "mlx-rs/safetensors"]
# Opt-in dynamic ONNX Runtime linking (loads libonnxruntime.{so,dylib,dll} at
# runtime instead of statically linking a prebuilt archive at build time).
#
# Use this when your build/release target cannot satisfy the static archive's
# requirements — e.g. a glibc <2.38 Linux host (ort's prebuilt static archive
# needs glibc ≥2.38 and fails at the release link step on ubuntu 22.04; see
# #50, #55) — and you can guarantee `libonnxruntime.*` is present on the
# runtime host.
#
# This feature is MUTUALLY EXCLUSIVE with `embedding-fastembed` (and with any
# feature that implies it: `embedding-fastembed-qwen3`, `-nomic-moe`,
# `-directml`, or `full`). Cargo feature unification merges both
# `ort-load-dynamic` and `ort-download-binaries-*` into the shared
# `fastembed`/`ort-sys` crate, silently turning the static path into a no-op
# (the original #50 failure mode); a `compile_error!` in `src/lib.rs` makes
# the conflict a hard build error instead. Enable exactly one of the two modes.
= ["embedding", "dep:fastembed", "dep:indexmap", "fastembed/hf-hub-rustls-tls", "fastembed/ort-load-dynamic"]
# Knowledge graph with async wrappers (requires tokio)
= ["graph", "dep:tokio"]
# Knowledge graph with multi-connection async pool (rusqlite + tokio semaphore).
# Provides higher read concurrency than `graph-async` for WAL-mode workloads.
= ["graph", "dep:tokio"]
# Telemetry framework (enum-gated events)
= ["dep:serde_json"]
# Safety utilities (secret masking, error classification)
= ["dep:regex"]
# Quality evaluation CLI (datasets-based metrics)
= ["dep:clap", "dep:anyhow", "tokens", "safety", "embedding", "search"]
= ["eval", "graph", "graph-cjk"]
# Everything except Windows-only execution backends and dev-only CLI tooling.
# Intentionally excluded:
# - embedding-fastembed-directml: pulls in the ort RC dependency, Windows-only.
# - embedding-fastembed-dynamic-linking: opt-in dynamic ONNX linking (see #50).
# - eval / eval-full: developer CLI tooling (the `llm-kernel-eval` binary),
# not part of the library surface. Enable explicitly to run the eval suite.
= ["provider", "discovery", "discovery-async", "client-async", "cache", "secrets", "store", "config", "graph", "graph-async", "graph-pool", "graph-cjk", "graph-pg", "graph-pg-tls", "graph-pg-sqlx", "mcp", "mcp-http", "tokens", "install", "search", "embedding", "embedding-openai", "embedding-fastembed", "embedding-fastembed-qwen3", "embedding-fastembed-nomic-moe", "embedding-mlx", "vector-index", "qdrant", "elastic", "pgvector", "federation", "telemetry", "safety", "catalog-sync"]
[]
# Always required
= { = "1", = ["derive"] }
= "2"
= "0.1"
# Only the `eval` / `catalog-sync` binaries use anyhow; keep it out of the
# default `provider` build and every library consumer's dependency graph.
= { = "1", = true }
# Feature-gated
= { = "1", = true }
= { = "3", = ["json"], = true }
= { = "3", = true }
= { = "0.3", = true }
= { = "1", = true }
= { = "0.13", = ["json", "rustls", "stream"], = false, = true }
= { = "0.32", = ["bundled"], = true }
= { = "1", = true }
= { = "1", = ["rt-multi-thread", "macros", "sync", "time"], = true }
= { = "0.1", = true }
= { = "0.3", = true }
= { = "0.3", = true }
= { = "0.1", = true }
= { = "1", = true }
# NOTE: fastembed's ort features (static download vs dynamic load) are selected
# by the `embedding-fastembed` / `embedding-fastembed-dynamic-linking` features
# below, NOT in this dependency declaration, so the two linking modes stay
# mutually exclusive at the feature level (see #55).
= { = "5", = false, = true }
# Pinned to the newest ort release-candidate: ort 2.0.0 stable is not yet
# published (2.0.0-rc.12 is the latest on crates.io as of 2026-06), and
# fastembed 5 targets this same RC, so the pin must move in lockstep with a
# fastembed release built against stable. Switch to a caret range (`2`) once
# both conditions hold.
= { = "=2.0.0-rc.12", = false, = true, = ["coreml"] }
# Pinned to match fastembed's candle-core: fastembed 5.17.3 pulls candle-core
# 0.11.0 (via candle-nn 0.11.0). Declaring 0.10 here previously caused two
# candle_core crate versions to coexist in the dep graph, breaking the
# `from_hf(device, dtype)` calls in qwen3.rs / nomic_moe.rs with E0308 (#74 CI).
= { = "0.11", = true }
= { = "2", = true }
= { = "4", = ["derive"], = true }
= { = "0.9", = true }
= { = "0.8", = false, = ["http1", "json", "tokio"], = true }
= { = "0.19", = true }
= { = "0.5", = true }
= { = "0.2", = true }
= { = "1", = true }
= { = "0.8", = false, = ["postgres", "runtime-tokio-rustls", "macros"], = true }
= { = "0.4", = false, = ["sqlx"], = true }
# macOS/aarch64-only deps for `embedding-mlx`. The target-cfg means these are
# never resolved on other platforms, so `full` (which includes `embedding-mlx`)
# builds cleanly under the Linux CI matrix. `safetensors` is provided via
# `mlx-rs/safetensors`, not listed separately here.
[]
= { = "0.25", = true }
= { = "0.23", = false, = ["fancy-regex"], = true }
= { = "0.5", = false, = ["ureq", "rustls-tls"], = true }
= { = "0.6", = true }
[]
= "3"
= { = "0.8", = ["html_reports", "async_tokio"] }
= { = "1", = ["macros", "rt", "rt-multi-thread"] }
[[]]
= "graph_bench"
= false
= ["graph"]
[[]]
= "compute_bench"
= false
= ["search", "tokens", "embedding"]
[[]]
= "concurrency_bench"
= false
= ["graph-pool", "graph-async"]
[[]]
= "scale_bench"
= false
= ["graph"]
[[]]
= "llm-kernel-eval"
= "src/bin/eval.rs"
= ["eval"]
[[]]
= "llm-kernel-migrate-graph"
= "src/bin/migrate.rs"
= ["graph-pg"]
[[]]
= "llm-kernel-sync-catalog"
= "src/bin/sync-catalog.rs"
= ["catalog-sync"]
[]
= 0
= 1
[]
= 3
= "thin"
= 1
= "symbols"
= "abort"
[]
= 3
= 4
[]
= "release"
= "thin"
[]
# docs.rs defaults to `--all-features`, which would activate the
# mutually-exclusive `embedding-fastembed` + `embedding-fastembed-dynamic-linking`
# and trip the `compile_error!` in src/lib.rs. Build docs with `full` instead (#55).
= ["full"]