vecboost 0.2.0

High-performance embedding vector service written in Rust
[package]
name = "vecboost"
version = "0.2.0"
edition = "2024"
authors = ["Kirky-X <kirky-x@outlook.com>"]
description = "High-performance embedding vector service written in Rust"
repository = "https://github.com/Kirky-X/vecboost"
documentation = "https://github.com/Kirky-X/vecboost"
homepage = "https://github.com/Kirky-X/vecboost"
license = "MIT"
keywords = ["embedding", "vector", "ml", "ai", "inference"]
categories = ["asynchronous", "science", "web-programming::http-server"]

[dependencies]
# Base async runtime & utilities (always required)
tokio = { version = "1.53", default-features = false, features = ["full"] }
async-trait = { version = "0.1", default-features = false }
futures = { version = "0.3", default-features = false, features = ["std", "async-await"] }
sys-info = { version = "0.9", default-features = false }
num_cpus = { version = "1.0", default-features = false }
xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] }
chrono = { version = "0.4", default-features = false, features = ["serde", "clock", "std"] }
regex = { version = "1.13", default-features = false, features = ["std"] }
sha2 = { version = "0.11", default-features = false, features = ["alloc"] }
rand = { version = "0.10", default-features = false, features = ["thread_rng", "alloc"] }
hex = { version = "0.4", default-features = false, features = ["std"] }
url = { version = "2.0", default-features = false }
zeroize = { version = "1.0", default-features = false, features = ["alloc"] }

# Serialization (base)
serde = { version = "1.0", default-features = false, features = ["derive", "std"] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }

# Error Handling (base)
thiserror = { version = "2.0", default-features = false }
anyhow = { version = "1.0", default-features = false, features = ["std"] }

# Module Registry (always required)
trait-kit = { version = "0.3", default-features = false, features = ["async"] }

# Configuration infrastructure (confers - 必选,完全接管配置,禁止手写 config/toml)
confers = { version = "0.4", default-features = false, features = ["toml", "env", "config-bus"] }

# Logging infrastructure (inklog + log - 必选,完全接管日志,禁止手写 tracing)
inklog = { version = "0.1", default-features = false }
log = { version = "0.4", default-features = false }

# Cache infrastructure (oxcache - 必选,完全接管缓存,禁止手写 lru)
oxcache = { version = "0.3", default-features = false, features = ["core"] }

# Rate limiting infrastructure (limiteron - 必选,完全接管速率限制,禁止手写)
limiteron = { version = "0.2", default-features = false }

# Database infrastructure (db feature)
# dbnexus re-exports ConnectionTrait/TransactionTrait, but not DatabaseBackend/Statement/Value/DbErr.
# Direct sea-orm dependency is still required for those types.
dbnexus = { version = "0.4", optional = true, default-features = false, features = ["sqlite", "runtime-tokio-rustls", "macros", "permission", "cache"] }
sea-orm = { version = "2.0.0", optional = true, default-features = false }

# AI & Math (base)
candle-core = { version = "0.11", default-features = false, features = [] }
candle-nn = { version = "0.11", default-features = false }
candle-transformers = { version = "0.11", default-features = false }
hf-hub = { version = "1.0", default-features = false, features = ["blocking", "rustls-tls"] }

# Web Framework (http feature)
axum = { version = "0.8", optional = true, default-features = false, features = ["http1", "json", "tokio", "tracing", "macros", "matched-path", "original-uri", "query"] }
axum-extra = { version = "0.12", optional = true, default-features = false, features = ["typed-header"] }
tower-http = { version = "0.7", optional = true, default-features = false, features = ["trace", "cors", "add-extension", "validate-request", "set-header", "timeout"] }

# OpenAPI Documentation (http feature)
utoipa = { version = "5.5", optional = true, default-features = false, features = ["axum_extras", "chrono", "uuid"] }
utoipa-swagger-ui = { version = "9.0", optional = true, default-features = false, features = ["axum", "url"] }
uuid = { version = "1.23", optional = true, default-features = false, features = ["v4", "serde"] }

# Monitoring (http feature)
prometheus = { version = "0.14", optional = true, default-features = false, features = ["process"] }
axum-prometheus = { version = "0.10", optional = true, default-features = false }

# HTTP client (http feature)
reqwest = { version = "0.13", optional = true, default-features = false, features = ["stream", "charset", "http2", "default-tls"] }

# gRPC is fully handled by sdforge (unified Call protocol via #[forge(grpc_method)])

# Auth feature
jsonwebtoken = { version = "10.0", optional = true, default-features = false, features = ["aws_lc_rs"] }
# RC 版本保留完整 semver:argon2 0.6 尚无稳定 release
argon2 = { version = "0.6.0-rc.8", optional = true, default-features = false, features = ["alloc", "password-hash", "getrandom"] }
aes-gcm = { version = "0.11", optional = true, default-features = false, features = ["alloc", "aes", "getrandom", "rand_core"] }

# Redis feature
redis = { version = "1.0", optional = true, default-features = false, features = ["tokio-comp", "connection-manager"] }

# ONNX feature
ndarray = { version = "0.17", optional = true, default-features = false, features = ["std"] }
# RC 版本保留完整 semver:ort 2.0 尚无稳定 release
ort = { version = "2.0.0-rc.12", optional = true, default-features = false }

# CUDA feature (candle-core/cuda 传递依赖 cudarc 0.19,支持 CUDA 13)
# 注意:项目代码不直接使用 cudarc,无需在此声明

# Multi-protocol SDK framework (sdforge - 通过 http/cli/mcp feature 启用,禁止手写接口)
# 版本约束用 minor 级别(规则25),允许 sdforge 0.4.x 的 minor 升级
sdforge = { version = "0.4", optional = true, default-features = false }

# CLI argument parsing (cli feature)
clap = { version = "4.6", optional = true, default-features = false, features = ["derive", "std", "help", "usage", "error-context"] }

# Model Context Protocol server (mcp feature). sdforge's `mcp` feature
# depends on `rmcp ~2.1`; we declare the same version so Cargo unifies to a
# single `rmcp` crate shared with sdforge (its MCP binding is built on it).
rmcp = { version = "2.1", optional = true, default-features = false, features = ["server", "transport-io"] }

[features]
default = ["http"]

# 协议特性
http = ["dep:axum", "dep:axum-extra", "dep:tower-http", "dep:utoipa", "dep:utoipa-swagger-ui", "dep:uuid", "dep:prometheus", "dep:axum-prometheus", "dep:reqwest", "sdforge/http", "sdforge/security"]
grpc = ["sdforge/grpc", "sdforge/ratelimit", "sdforge/security"]
cli = ["sdforge/cli", "dep:clap"]
openapi = ["dep:utoipa", "dep:utoipa-swagger-ui", "sdforge/openapi", "sdforge/docs"]
# MCP (Model Context Protocol) server over stdio, generated by sdforge's
# `#[forge(tool_name = ...)]` macros (which register tools into the inventory)
# and served via `sdforge::mcp::build()` on rmcp's stdio transport. Exposes
# VecBoost embedding tools (embed / embed_batch / similarity) to LLM clients.
# Run with: `vecboost --mcp`.
mcp = ["sdforge/mcp", "dep:rmcp"]

# 存储特性
db = ["dep:dbnexus", "dep:sea-orm"]
postgres = ["db", "dbnexus/postgres"]

# 功能特性
auth = ["dep:jsonwebtoken", "dep:argon2", "dep:aes-gcm"]
redis = ["dep:redis"]

# 引擎特性
cuda = ["candle-core/cuda", "candle-nn/cuda"]
metal = ["candle-core/metal", "candle-nn/metal"]
onnx = ["dep:ndarray", "dep:ort", "ort/ndarray", "ort/std", "ort/alternative-backend"]

# Platform-specific dependencies
[target.'cfg(target_os = "macos")'.dependencies]
tokenizers = { version = "0.15", default-features = false, features = ["http"] }

[target.'cfg(target_os = "linux")'.dependencies]

[target.'cfg(target_os = "windows")'.dependencies]

[dev-dependencies]
mockall = { version = "0.15", default-features = false }
tower = { version = "0.5", default-features = false, features = ["util"] }
tokio = { version = "1.53", default-features = false, features = ["test-util", "macros", "rt-multi-thread"] }
tempfile = { version = "3.0", default-features = false }
# tracing/tracing-subscriber/toml 仅测试用(logger/tests.rs 验证 inklog subscriber 集成 + config 测试解析 toml)
tracing = { version = "0.1", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter"] }
toml = { version = "1.1", default-features = false }

[profile.dev]
opt-level = 1

# ─────────────────────────────────────────────────────────────────────────────
# Workspace — examples 作为独立 crate(member),不发布
# ─────────────────────────────────────────────────────────────────────────────
[workspace]
members = [".", "examples"]
resolver = "2"

[workspace.package]
license = "MIT"
edition = "2024"
authors = ["Kirky-X <kirky-x@outlook.com>"]