Skip to content

feat(frontend): add native Messages and Responses APIs - #184

Merged
shiweijiezero merged 4 commits into
mainfrom
feat/native-client-apis
Sep 25, 2026
Merged

shiweijiezero merged 4 commits into
mainfrom
feat/native-client-apis

Conversation

@shiweijiezero

@shiweijiezero shiweijiezero commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Goal

Let Chat Completions, Claude Code, and Codex clients use the same Foretoken frontend and model service through their native APIs.

Design

  • Group OpenAI Completions, Anthropic Messages, and OpenAI Responses under one API layer. Share request timing, chat dispatch, decoding, idle timeouts, and SSE heartbeats; keep each protocol's request and response formats separate.
  • Reuse the existing generation service for model preparation, routing, and execution. One deadline covers the request through completion, and disconnects release backend work and routing reservations.
  • Adapt the Messages and Responses support from vLLM's Rust frontend work, retaining upstream provenance and license notices. No protocol-conversion service is added.
  • Support JSON and streaming output, client-executed tools, reasoning, and Messages token counting. Preserve output-budget exhaustion and incomplete tool-call semantics.
  • Keep vLLM patches together and synchronize their build consumers. The frontend guides provide minimal requests and the settings clients need.

Interface

API Endpoint
Chat Completions POST /v1/chat/completions
Messages POST /v1/messages
Messages token counting POST /v1/messages/count_tokens
Responses POST /v1/responses

All generation endpoints accept stream: true. Responses clients set store: false and send conversation history on each turn. Clients execute tools and return their results in the next request. Messages uses max_tokens as the total output budget, including reasoning.

Impact

Existing frontend deployments gain these routes without a protocol-selection setting. The request timeout covers admission, preparation, and generation. Server-side conversation storage, background responses, and hosted tools are outside these APIs' supported mode.

@shiweijiezero
shiweijiezero changed the base branch from feat/multinode-model-groups to main September 25, 2026 00:33
@shiweijiezero
shiweijiezero marked this pull request as ready for review September 25, 2026 00:40
@shiweijiezero
shiweijiezero merged commit 3d27569 into main Sep 25, 2026
5 checks passed
@shiweijiezero
shiweijiezero deleted the feat/native-client-apis branch September 25, 2026 00:41
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