Files
asepharyana-hub-llm-api/Cargo.toml
T
Asep Haryana e1f5195407 feat: add SSE streaming support (OpenAI-compatible)
- Token-by-token streaming via Server-Sent Events
- tokio::sync::mpsc channel + ReceiverStream for clean async
- OpenAI SSE format: role chunk → content chunks → finish chunk
- Non-streaming still works with the same code path
- Uses spawn_blocking pattern for CPU-bound inference
2026-07-25 11:33:59 +07:00

27 lines
612 B
TOML

[package]
name = "llm-api"
version = "0.1.0"
edition = "2021"
[dependencies]
# LLM inference
llama-cpp-2 = "0.1"
# HTTP server
axum = { version = "0.8", features = ["json"] }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
tower-http = { version = "0.6", features = ["cors", "trace"] }
# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Utilities
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
anyhow = "1"
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] }
futures = "0.3"