rustvani 0.4.0-dev.10

Voice AI framework for Rust — real-time speech pipelines with STT, LLM, TTS, and Dhara conversation flows
[package]

name = "rustvani"

version = "0.4.0-dev.10"

edition = "2021"

license = "BSD-2-Clause"

description = "Voice AI framework for Rust — real-time speech pipelines with STT, LLM, TTS, and Dhara conversation flows"

repository = "https://github.com/Allenmylath/rustvani"

homepage = "https://github.com/Allenmylath/rustvani"

documentation = "https://docs.rs/rustvani"

readme = "README.md"

keywords = ["voice", "ai", "speech", "pipeline", "conversational-ai"]

categories = ["multimedia::audio", "asynchronous", "api-bindings"]

exclude = [

    "src/bin/*", "dhara/*", "tests/*", "examples/*", ".env*",

    "piper-models/*", "assets/*", "src/vad/data/silero.onnx",

    "src/turn/smart_turn_weights.bin.gz",

]



# ---------------------------------------------------------------------------

# Features

# ---------------------------------------------------------------------------

[features]

default = ["vad-silero-ort", "transport-websocket", "serializer-twilio", "stt-sarvam", "stt-60db", "stt-deepgram", "llm-openai", "llm-sarvam", "tts-deepgram", "dhara", "db-postgres"]



# Silero VAD — ONNX (ort) inference backend. Gates only the ort-based path

# (`SileroVadOrt`) and its `ort`/C-C++ dependency; the pure-Rust `SileroVadNative`

# backend is always compiled and needs no feature.

vad-silero-ort = ["dep:ort", "dep:ndarray"]



# Transport

transport-websocket = ["dep:axum", "dep:tower-http", "dep:tokio-tungstenite"]

# Twilio serializer auto-hangup — pulls reqwest for the REST call. The Twilio

# serializer itself builds under `transport-websocket`; only the hang-up body is

# gated here.

serializer-twilio = ["dep:reqwest", "transport-websocket"]

# Peer-to-peer WebRTC transport (webrtc-rs), feature name `vaniwebrtc`. Opt-in:

# pulls a large dep tree and needs a C build toolchain (audiopus/libopus → cmake

# + a C compiler; MSVC on Windows). Reuses the already-optional axum/tower-http

# used by the WS transport.

vaniwebrtc = ["dep:webrtc", "dep:audiopus", "dep:axum", "dep:tower-http"]



# Services

stt-sarvam = ["dep:tokio-tungstenite"]

stt-60db = ["dep:tokio-tungstenite"]

stt-deepgram = ["dep:tokio-tungstenite"]

stt-gnani = ["dep:tokio-tungstenite"]

llm-openai = ["dep:reqwest"]

# Sarvam chat-completions (HTTP + SSE). Previously gated on `stt-sarvam`, which

# only worked while that feature happened to carry reqwest; Sarvam STT is a

# WebSocket service and no longer does.

llm-sarvam = ["dep:reqwest"]

tts-deepgram = ["dep:tokio-tungstenite"]

tts-sarvam = ["dep:tokio-tungstenite"]

tts-piper = ["dep:ort"]



# Dhara conversation flow system.

#

# Does NOT gate `thiserror` — `src/error/mod.rs` derives on it unconditionally,

# so that is a core dependency (see below).

#

# Requires `llm-openai` (dhara's loader/manager use

# `services::llm::openai::TransitionHook`) and `transport-websocket`

# (`dhara::dctx` uses `crate::ravi`, which is gated on it).

dhara = ["llm-openai", "transport-websocket"]



# Database tools (optional — not in default)

db-postgres = ["dep:tokio-postgres", "dep:postgres-native-tls", "dep:native-tls"]





# ---------------------------------------------------------------------------

# Dependencies

# ---------------------------------------------------------------------------

[dependencies]

# Core (always required)

tokio           = { version = "1",   features = ["full"] }

tokio-util      = { version = "0.7", features = ["rt"] }

arc-swap        = "1"

bytes           = "1"

async-trait     = "0.1"

async-recursion = "1"

futures         = "0.3"

log             = "0.4"

serde           = { version = "1",   features = ["derive"] }

serde_json      = "1"

base64          = "0.22"



# Audio processing (always required for voice pipeline)

hound           = "3"

nnnoiseless     = "0.1"

hush-vani       = "0.1"

rubato          = "0.14"

rustfft         = "6"

flate2          = "1"

matrixmultiply  = "0.3"



# VAD — Silero via ONNX Runtime

ort             = { version = "=2.0.0-rc.10", features = ["ndarray", "download-binaries"], optional = true }

ndarray         = { version = "0.16", optional = true }



# Transport — WebSocket (axum server + tungstenite)

axum            = { version = "0.7", features = ["ws"], optional = true }

tower-http      = { version = "0.5", features = ["cors"], optional = true }

tokio-tungstenite = { version = "0.29", features = ["rustls-tls-webpki-roots"], optional = true }



# Transport — peer-to-peer WebRTC (webrtc-rs RTP/SRTP + audiopus Opus codec)

webrtc          = { version = "0.11", optional = true }

audiopus        = { version = "0.2",  optional = true }



# HTTP client (LLM + STT services)

reqwest         = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls", "http2"], optional = true }



# Error types. Not optional: `PipecatError` in src/error/mod.rs derives

# thiserror::Error and is compiled in every configuration, so gating this behind

# a feature makes the crate uncompilable without that feature.

thiserror       = "1"



# Database — Postgres (optional tool)

tokio-postgres      = { version = "0.7", features = ["with-serde_json-1", "with-chrono-0_4", "with-uuid-1"], optional = true }

postgres-native-tls = { version = "0.5", optional = true }

native-tls          = { version = "0.2", optional = true }



# Used by db-postgres tools

chrono          = { version = "0.4", features = ["serde"] }

uuid            = { version = "1",   features = ["serde", "v4"] }



# Logging and env helpers (used by release binaries — excluded from publish via src/bin/*)

env_logger      = "0.11"

dotenvy         = "0.15"



# ---------------------------------------------------------------------------

# Dev dependencies

# ---------------------------------------------------------------------------

[dev-dependencies]

tokio      = { version = "1", features = ["full", "test-util"] }



# ---------------------------------------------------------------------------

# Binaries that need opt-in features

#

# Without these declarations a plain `cargo build` tries to compile every

# `src/bin/*.rs` under the default feature set and fails on the ones that use a

# gated service. `required-features` makes cargo skip them instead.

# ---------------------------------------------------------------------------

[[bin]]

name = "vaniwebrtc_server"

# Uses SarvamTtsHandler in addition to the WebRTC transport.

required-features = ["vaniwebrtc", "tts-sarvam"]



[[bin]]

name = "websocket_server"

required-features = ["tts-sarvam"]



[[bin]]

name = "ravi_server"

required-features = ["tts-sarvam"]



[[bin]]

name = "sarvam_tts_test"

required-features = ["tts-sarvam"]



[[bin]]

name = "websocket_server_piper"

required-features = ["tts-piper"]



[[bin]]

name = "llm_only_test"

required-features = ["llm-sarvam"]