Skip to content

vllm-project/agentic-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

69 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšก Agentic API

The stateful, agentic API layer for vLLM, written in Rust ๐Ÿฆ€

Run OpenAI-grade agentic workloads (Responses API, server-side tools, Codex) on your own GPUs.

License Rust CI pre-commit


๐Ÿง  Overview

vLLM gives you state-of-the-art inference throughput. But real agentic applications need more than raw tokens: they need conversation state, tool-call loops, and multi-turn orchestration. Today, all of that complexity lives in your client code.

Agentic API moves it server-side. It is a Rust-native gateway that sits in front of vLLM and owns the stateful agentic APIs, starting with an OpenAI-compatible Responses API. Your application makes one API call and the server handles the rest: state hydration, tool execution, streaming, and continuation.

flowchart LR
    C(["๐Ÿง‘โ€๐Ÿ’ป Client<br/>Codex ยท SDKs ยท curl"]) -->|"๐Ÿ“ฎ <code>POST /v1/responses</code><br/>๐ŸŒ HTTP&nbsp;&nbsp;๐Ÿ“ก SSE&nbsp;&nbsp;๐Ÿ”Œ WebSocket"| A
    subgraph A ["โšก Agentic API (Rust ๐Ÿฆ€)"]
        direction TB
        S["๐Ÿ”„ State hydration<br/><code>previous_response_id</code>"]
        T["๐Ÿ› ๏ธ Server-side tools<br/>web search ยท functions"]
        P["๐Ÿ’พ Persistence<br/>SQLite response store"]
    end
    A -->|"๐Ÿš€ <code>POST /v1/responses</code><br/>โš™๏ธ stateless&nbsp;&nbsp;๐Ÿค OpenAI-compatible"| V(["๐Ÿš€ vLLM core<br/>inference engine"])

    classDef client fill:#FFE8B3,stroke:#F59E0B,stroke-width:2px,color:#7C2D12
    classDef inner fill:#E0E7FF,stroke:#6366F1,stroke-width:2px,color:#312E81
    classDef engine fill:#DCFCE7,stroke:#22C55E,stroke-width:2px,color:#14532D

    class C client
    class S,T,P inner
    class V engine
    style A fill:#F5F3FF,stroke:#8B5CF6,stroke-width:2px,color:#5B21B6
    linkStyle 0 stroke:#F59E0B,stroke-width:2px
    linkStyle 1 stroke:#22C55E,stroke-width:2px
Loading

Tip

Point OpenAI Codex at Agentic API and drive it entirely with open models served by vLLM. No OpenAI account required.

โœจ Key Features

  • ๐Ÿ”„ Stateful conversations: the server manages history via previous_response_id. No client-side message tracking, no replaying full transcripts.
  • ๐Ÿ› ๏ธ Server-side tool execution: an explicit tool-ownership model (gateway / client / provider) decides exactly what runs where. Web search ships today via You.com, and the model executes multi-step tool chains automatically.
  • ๐Ÿ“ก Every transport: non-streaming HTTP, server-sent events for token streaming, and full WebSocket support for interactive clients.
  • ๐Ÿงฐ Codex-ready: accepts Codex-shaped Responses traffic out of the box, preserving the tool declarations and response item shapes Codex depends on.
  • ๐Ÿƒ Background execution: fire-and-forget requests that keep processing server-side.
  • โœ… Compatibility tested: validated against the Open Responses compatibility suite, with replay-cassette tests for real OpenAI and vLLM traffic.

๐Ÿงญ API Surface

Endpoint Description Status
POST /v1/responses OpenAI-compatible Responses API with state, tools, and streaming โœ…
GET /v1/responses WebSocket transport for the Responses API โœ…
POST /v1/conversations Conversation management โœ…
GET /v1/models Model listing proxied from vLLM โœ…
GET /health ยท GET /ready Liveness and readiness probes โœ…
Messages API Anthropic-style stateful messages on shared primitives ๐Ÿšง Planned
Interactions API Higher-level agentic workflow surface โณ Planned

๐Ÿš€ Quickstart

1. Serve a model with vLLM. Any recipe from recipes.vllm.ai works:

vllm serve Qwen/Qwen3-30B-A3B-FP8 \
  --tool-call-parser qwen3_coder --enable-auto-tool-choice \
  --reasoning-parser qwen3 --port 5050

2. Start Agentic API, pointing it at the vLLM server (set the YOU_* variables to enable built-in web search):

YOU_API_KEY=<your-you.com-api-key> YOU_API_BASE_URL=<you.com-api-base-url> \
  cargo run -p agentic-server -- --llm-api-base http://0.0.0.0:5050

3. Make a stateful call:

curl http://localhost:9000/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-30B-A3B-FP8",
    "input": "What is new in vLLM this month?",
    "tools": [{"type": "web_search"}]
  }'

Continue the conversation by passing the returned id as previous_response_id, and the server rehydrates everything for you.

๐Ÿค– Codex on your own GPUs

Agentic API speaks the Responses wire protocol Codex expects, including WebSockets, so you can run the full Codex experience against open models.

Add a provider to ~/.codex/config.toml:

[model_providers.agentic-api]
name = "agentic-api"
base_url = "http://localhost:9000/v1"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = true

Then launch Codex:

codex --disable image_generation -c model_provider=agentic-api -m Qwen/Qwen3-30B-A3B-FP8

๐Ÿงฉ Tool Ownership Model

Every tool call has exactly one execution path, so nothing runs by accident:

Ownership Who executes it Examples
Gateway-owned Agentic API executes it server-side and continues the loop Web search, file search, MCP-backed tools
Client-owned Preserved and returned to the client Codex shell / editor tools, your functions
Provider-owned Passed through to vLLM or an upstream provider Provider-native tools

Unknown or ambiguous tool shapes are never executed by default. They are preserved and returned.

๐Ÿ—๏ธ Repository Layout

crates/
โ”œโ”€โ”€ agentic-server/       # Axum binary, transport handlers (HTTP/SSE/WS), configuration
โ”œโ”€โ”€ agentic-server-core/  # Protocol types, executor, tool framework, persistence
โ””โ”€โ”€ agentic-praxis/       # Praxis gateway integration
docs/                     # MkDocs documentation, ADRs, and design notes

๐Ÿ› ๏ธ Developing

cargo build                                  # build
cargo test                                   # test
cargo clippy --all-targets -- -D warnings    # lint
cargo fmt -- --check                         # format check

Docs are built with MkDocs:

uv venv
uv pip install -r docs/requirements.txt
uv run mkdocs serve

Design and migration decisions are tracked as ADRs in docs/adr/, with deeper design notes in docs/design/. See the full ROADMAP for where the project is heading, and CONTRIBUTING to get involved.

๐Ÿ—บ๏ธ Roadmap at a Glance

  • Responses API hydration: stateful continuation with previous_response_id
  • Codex support: practical Codex sessions through the Responses API
  • Server-side tool execution: explicit ownership, web search built in
  • Messages API: built on the same persistence and execution primitives
  • Interactions API: durable, higher-level agentic workflows
  • Production hardening: storage backends, observability, cached-prefix continuation

๐Ÿ“„ License

Licensed under the Apache License 2.0.

โญ If Agentic API saves you from writing one more client-side tool loop, star the repo! โญ

About

Stateful API logic for agentic applications using vLLM

Resources

License

Code of conduct

Contributing

Stars

48 stars

Watchers

5 watching

Forks

Packages

 
 
 

Contributors