-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCargo.toml
More file actions
executable file
·299 lines (240 loc) · 9.82 KB
/
Cargo.toml
File metadata and controls
executable file
·299 lines (240 loc) · 9.82 KB
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
# Cargo workspace configuration
[workspace]
members = [".", "crates/ares-vector"]
exclude = ["ui", "crates/pawan"]
resolver = "2"
[workspace.package]
version = "0.6.2"
edition = "2021"
license = "MIT"
repository = "https://github.com/dirmacs/ares"
authors = ["Dirmacs <build@dirmacs.com>"]
[workspace.dependencies]
# Shared dependencies across workspace
ares-vector = { version = "0.1.1", path = "crates/ares-vector" }
tokio = { version = "1.48", features = ["rt-multi-thread", "macros", "net", "sync", "time", "io-util", "signal", "fs", "process"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"
tracing = "0.1"
uuid = { version = "1.19", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
async-trait = "0.1"
[package]
name = "ares-server"
version.workspace = true
edition.workspace = true
rust-version = "1.91"
description = "A.R.E.S - Agentic Retrieval Enhanced Server: A production-grade agentic chatbot server with multi-provider LLM support, tool calling, RAG, and MCP integration"
license.workspace = true
repository.workspace = true
homepage = "https://github.com/dirmacs/ares"
documentation = "https://docs.rs/ares-server"
readme = "README.md"
keywords = ["llm", "chatbot", "agent", "rag", "ai"]
categories = ["web-programming", "asynchronous", "command-line-utilities"]
authors.workspace = true
exclude = [
"data/*",
"target/*",
".env",
".env.example",
"*.db",
"docker-compose*.yml",
"Dockerfile",
"hurl/*",
"scripts/*",
]
# Library configuration - allows other projects to use this as a dependency
[lib]
name = "ares"
path = "src/lib.rs"
# Binary configuration - allows running as standalone server
[[bin]]
name = "ares-server"
path = "src/main.rs"
[features]
# Default features for local-first development
default = ["postgres", "ollama", "ares-vector", "mcp"]
# ============= LLM Providers =============
# Ollama - Local LLM inference via Ollama server
ollama = ["dep:ollama-rs"]
# OpenAI - OpenAI API and compatible endpoints
openai = ["dep:async-openai"]
# LlamaCpp - Direct GGUF model loading via llama.cpp
llamacpp = ["dep:llama-cpp-2"]
# Anthropic - Claude API
anthropic = ["dep:claude-sdk"]
# LlamaCpp GPU backends (mutually exclusive - pick one)
llamacpp-cuda = ["llamacpp", "llama-cpp-2/cuda"]
llamacpp-metal = ["llamacpp", "llama-cpp-2/metal"]
llamacpp-vulkan = ["llamacpp", "llama-cpp-2/vulkan"]
# ============= Database Backends =============
# PostgreSQL database via sqlx (default)
postgres = []
# ============= Vector Store Backends =============
# ares-vector - Pure Rust embedded vector database with HNSW (default, local-first)
# No native dependencies, compiles anywhere Rust does
ares-vector = ["dep:ares-vector"]
# LanceDB - Serverless, embedded vector database
# Note: Requires protoc compilation, may have issues on Windows MSVC
lancedb = ["dep:lancedb", "dep:lance"]
# Qdrant vector database for semantic search
qdrant = ["dep:qdrant-client"]
# pgvector - PostgreSQL extension for vector similarity search
pgvector = []
# ChromaDB - Simple, open-source embedding database
chromadb = ["dep:chromadb"]
# Pinecone - Managed cloud vector database (alpha)
pinecone = ["dep:pinecone-sdk"]
# ============= Additional Features =============
# MCP (Model Context Protocol) server support
mcp = ["dep:rmcp"]
# Eruka context injection - fetches per-agent context from Eruka with caching
eruka-context = []
# Local embeddings - fastembed-based ONNX embedding models
# WARNING: This feature does NOT work on Windows MSVC due to ort-sys linker errors.
# Use WSL, Linux, or macOS for local embeddings, or use remote embedding APIs instead.
local-embeddings = ["dep:fastembed"]
# Email sending via SMTP (opt-in, requires lettre feature)
email = ["dep:lettre"]
# Web search and scraping tools (opt-in, daedra + scraper)
search-tools = ["dep:daedra", "dep:scraper"]
# ============= UI =============
# Embedded UI - serves the Leptos frontend from the backend
ui = ["dep:rust-embed", "dep:mime_guess"]
# Swagger UI - interactive API documentation (requires network during build)
swagger-ui = ["dep:utoipa-swagger-ui"]
# ============= Feature Bundles =============
# All LLM providers
all-llm = ["ollama", "openai", "llamacpp", "anthropic"]
# All database backends
all-db = ["postgres"]
# All vector stores (excluding lancedb due to protoc issues on Windows)
all-vectorstores = ["ares-vector", "qdrant", "pgvector", "chromadb", "pinecone"]
# Local-first vector stores (no external server required)
local-vectorstores = ["ares-vector"]
# Full feature set for development/testing (Windows-compatible)
# Note: local-embeddings excluded due to ort-sys linker issues on Windows MSVC
full = ["ollama", "openai", "llamacpp", "anthropic", "postgres", "qdrant", "ares-vector", "mcp", "swagger-ui"]
# Full feature set with local embeddings (Linux/macOS only - NOT Windows MSVC)
full-local-embeddings = ["full", "local-embeddings"]
# Full feature set with UI
full-ui = ["full", "ui"]
# Full feature set with UI and local embeddings (Linux/macOS only)
full-ui-local-embeddings = ["full-ui", "local-embeddings"]
# Minimal build - no optional features
minimal = []
[dependencies]
# CLI and TUI
clap = { version = "4.5", features = ["derive", "color", "env", "suggestions"] }
owo-colors = "4.1"
# Core dependencies
anyhow = "1.0.100"
async-stream = "0.3.6"
async-trait = "0.1.89"
chrono = { version = "0.4.42", features = ["serde"] }
futures = "0.3.31"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
thiserror = "2.0.17"
tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "net", "sync", "time", "io-util", "signal", "fs", "process"] }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.22", features = ["env-filter", "json"] }
uuid = { version = "1.19.0", features = ["v4", "serde"] }
# Web framework
axum = { version = "0.8.7", features = ["macros", "multipart"] }
tower = { version = "0.5.2", features = ["util", "timeout"] }
tower-http = { version = "0.6.8", features = ["trace", "cors", "limit"] }
tower-sessions = "0.14.0"
tower_governor = "0.8"
# HTTP client
reqwest = { version = "0.12.26", default-features = false, features = ["json", "rustls-tls", "multipart"] }
# Authentication
argon2 = "0.5.3"
jsonwebtoken = { version = "10.3.0", features = ["use_pem", "rust_crypto"] }
sha2 = "0.10.9"
rand = "0.9.2"
hex = "0.4"
# Configuration
config = "0.15.19"
dotenvy = "0.15.7"
toml = "0.9.8"
toon-format = { version = "0.4.1", default-features = false } # cli feature drags in tiktoken-rs, syntect, arboard, ratatui
notify = "8.2.0"
parking_lot = "0.12.5"
arc-swap = "1.7.1"
# Vector database (optional)
# ares-vector - Pure Rust embedded vector DB (default, recommended)
ares-vector = { workspace = true, features = ["serde"], optional = true }
# External vector DBs
qdrant-client = { version = "1.16.0", optional = true }
lancedb = { version = "0.23.1", optional = true }
# Lance with protoc feature compiles protobuf compiler from source - may have issues on Windows
lance = { version = "1.0.1", features = ["protoc"], default-features = false, optional = true }
sqlx = { version = "0.8.6", features = ["runtime-tokio", "postgres", "tls-rustls", "uuid", "chrono", "json", "migrate"] }
chromadb = { version = "2.3.0", optional = true }
pinecone-sdk = { version = "0.1.2", optional = true }
# LLM Providers (optional)
ollama-rs = { version = "0.3.3", features = ["stream"], optional = true }
async-openai = { version = "0.33.1", features = ["chat-completion"], optional = true }
llama-cpp-2 = { version = "0.1.130", optional = true }
claude-sdk = { version = "1.0.0", optional = true }
# Embeddings and RAG
fastembed = { version = "5.5.0", optional = true }
# rig-core removed - was unused in codebase
text-splitter = "0.19" # char-based only — tiktoken-rs removed (unused, was ~35s of compile)
lru = "0.16.3" # 0.16.3+ fixes RUSTSEC-2026-0002 (stacked borrows unsound in IterMut)
# Web scraping and search (optional — gated by search-tools feature)
daedra = { version = "0.1.4", optional = true }
scraper = { version = "0.25.0", optional = true }
# OpenSSL vendored build (for systems without pkg-config/libssl-dev)
# openssl = { version = "0.10", features = ["vendored"] }
# Schema and documentation
schemars = { version = "1.1.0", features = ["derive"] }
utoipa = { version = "5.4.0", features = ["axum_extras", "chrono", "uuid"] }
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"], optional = true }
# MCP support (optional)
rmcp = { version = "0.12.0", features = ["server", "client", "transport-io", "macros"], optional = true }
# Email sending via SMTP (optional — gated by email feature)
lettre = { version = "0.11", features = ["tokio1-native-tls", "builder", "smtp-transport"], optional = true }
# UI embedding (optional)
rust-embed = { version = "8.9", optional = true }
mime_guess = { version = "2.0", optional = true }
[dev-dependencies]
# Testing utilities
axum-test = "18.4.1"
mockall = "0.14.0"
rstest = "0.26.1"
tempfile = "3.23.0"
wiremock = "0.6.5"
# Note: cargo-llvm-cov is a CLI tool, not a library dependency
# Install with: cargo install cargo-llvm-cov
[profile.dev]
opt-level = 0
debug = true
incremental = true
split-debuginfo = "unpacked" # faster incremental link on Linux
[profile.release]
opt-level = 3
lto = "thin" # full LTO OOMs on 8GB VPS; thin LTO is ~80% of the gains at 30% of the memory
codegen-units = 4
strip = true
# Fast iteration release — skips LTO for quicker deploy builds
[profile.release-fast]
inherits = "release"
lto = false
codegen-units = 16
opt-level = 2
[profile.test]
opt-level = 0
debug = true
incremental = true
# Documentation settings
[package.metadata.docs.rs]
# Don't use all-features because llamacpp and qdrant have build scripts
# that fail in docs.rs's sandboxed read-only environment
features = ["ollama", "openai", "postgres", "mcp"]
rustdoc-args = ["--cfg", "docsrs"]
[patch.crates-io]
async-openai = { path = "vendor/async-openai" }