Skip to content

feat: make server deps optional behind server feature flag#400

Open
emanueleDiVizio wants to merge 1 commit into
EricLBuehler:masterfrom
emanueleDiVizio:feat/optional-server-deps
Open

feat: make server deps optional behind server feature flag#400
emanueleDiVizio wants to merge 1 commit into
EricLBuehler:masterfrom
emanueleDiVizio:feat/optional-server-deps

Conversation

@emanueleDiVizio

Copy link
Copy Markdown

Summary

  • Makes axum, hyper, tower-http, utoipa, and rustchatui optional dependencies behind a new server feature flag
  • The server feature is enabled by default, so this is fully backwards-compatible
  • Gates server-specific types (ChatResponder, IntoResponse impl, Stream impl for Streamer, etc.) behind #[cfg(feature = "server")]

Motivation

This allows candle-vllm to be used as a library dependency for embedding/inference workloads without pulling in the HTTP server stack. Useful when candle-vllm is embedded in another application that provides its own API layer.

Test plan

  • cargo build (default features, includes server) — should compile as before
  • cargo build --no-default-features — should compile without server deps
  • cargo build --no-default-features --features cuda — CUDA without server

… flag

This allows candle-vllm to be used as a library for embedding/inference
without pulling in the HTTP server stack (axum, hyper, tower-http,
utoipa, rustchatui). The `server` feature is enabled by default for
backwards compatibility.
@emanueleDiVizio emanueleDiVizio force-pushed the feat/optional-server-deps branch from 384950e to c3ef853 Compare April 2, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant