Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 7 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
[package]
name = "agentic-api"
[workspace]
members = ["crates/*"]
resolver = "3"

[workspace.package]
version = "0.1.0"
edition = "2024"
description = "Stateful API logic for agentic applications using vLLM"
license = "Apache-2.0"
repository = "https://github.com/vllm-project/agentic-api"

[dependencies]
axum = "0.8"
bytes = "1"
clap = { version = "4", features = ["derive", "env"] }
futures = "0.3"
http = "1"
reqwest = { version = "0.12", features = ["stream"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
tokio = { version = "1", features = ["full"] }
tower-http = { version = "0.6", features = ["cors"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[dev-dependencies]
criterion = { version = "0.5", features = ["async_tokio"] }
reqwest = { version = "0.12", features = ["json"] }

[[bench]]
name = "proxy_bench"
harness = false

[lints.rust]
[workspace.lints.rust]
unsafe_code = "forbid"

[lints.clippy]
[workspace.lints.clippy]
all = { level = "deny", priority = -1 }
pedantic = { level = "warn", priority = -1 }
21 changes: 21 additions & 0 deletions crates/agentic-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "agentic-core"
description = "Framework-agnostic core library for agentic-api"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
bytes = "1"
futures = "0.3"
http = "1"
reqwest = { version = "0.12", features = ["stream"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
tokio = { version = "1", features = ["time"] }
tracing = "0.1"

[lints]
workspace = true
23 changes: 4 additions & 19 deletions src/config.rs → crates/agentic-core/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
use clap::Args;

#[derive(Debug, Clone, Args)]
pub struct RuntimeConfig {
#[arg(skip)]
#[derive(Debug, Clone)]
pub struct Config {
pub llm_api_base: String,

#[arg(long, env = "OPENAI_API_KEY", hide_env_values = true)]
pub openai_api_key: Option<String>,

#[arg(long, default_value = "0.0.0.0")]
pub gateway_host: String,

#[arg(long, default_value_t = 9000)]
pub gateway_port: u16,

#[arg(long, default_value_t = 600.0)]
pub vllm_ready_timeout_s: f64,

#[arg(long, default_value_t = 2.0)]
pub vllm_ready_interval_s: f64,
pub llm_ready_timeout_s: f64,
pub llm_ready_interval_s: f64,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to errors.rs let's only keep in config that agentic-core would need.
I think as off now agentic-core wouldnt need any config till we setup database and the rest of the features in core.

}

#[must_use]
Expand Down
8 changes: 4 additions & 4 deletions src/error.rs → crates/agentic-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pub enum Error {
#[error("failed to build HTTP client")]
HttpClient(#[source] reqwest::Error),

#[error("vLLM not ready within {timeout_s:.0}s at {url}")]
VllmTimeout { url: String, timeout_s: f64 },
#[error("LLM not ready within {timeout_s:.0}s at {url}")]
LlmTimeout { url: String, timeout_s: f64 },

#[error("vLLM subprocess exited before becoming ready: {status}")]
VllmProcessExited { status: String },
#[error("LLM subprocess exited before becoming ready: {status}")]
LlmProcessExited { status: String },
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's separate out the error that is related to agentic-server to there. since agentic-server would be setting up the gateway so some of the errors would belong to server only. IO error can stay here. what do you think?


#[error(transparent)]
Io(#[from] io::Error),
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs → crates/agentic-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod app;
pub mod config;
pub mod error;
pub mod proxy;
pub mod server;
pub mod readiness;
Loading