Repository navigation
feat: public Responses API endpoint (#127) - #167
Open
joshfactorial wants to merge 2 commits into
Open
joshfactorial wants to merge 2 commits into
joshfactorial wants to merge 2 commits into
Conversation
POST /api/public/v1/deployment/{deploymentId}/responses proxies OpenAI
Responses API requests to the deployment's /v1/responses through the
shared public proxy (#137): same API-key checks, the deployment's own
vLLM key upstream, and the reply passed through, streamed or not.
Stateless only. vLLM's response store stays off, so `store` is ignored
and previous_response_id, background mode and retrieve/cancel aren't
available; the route's header says so. The shared proxy's security note
now also states that the caller's LLMHub key is never forwarded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same auth and proxy cases as the embeddings route, plus the deployment's vLLM key being sent (never the caller's), an SSE stream passing through unchanged, and vLLM's 404 for previous_response_id (its real error body) reaching the caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
max-zilla
self-requested a review
November 5, 2026 15:34
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #127. Part of #128.
Adds
POST /api/public/v1/deployment/{deploymentId}/responses, the OpenAI Responses API, on the public API only (not the chat page). It reuses #137's sharedproxyPublicDeploymentEndpoint, so it gets the same API-key checks as chat completions and embeddings, sends the deployment's own vLLM key upstream (#147), and passes the reply through, streamed or not.What's supported
It's stateless (see the analysis in #127):
inputandinstructions, sampling settings, and structured output"stream": true): vLLM's Responses event stream passes through unchangedinputas a list of messages)previous_response_id(vLLM returns 404),background, and retrieving or cancelling a stored response.store: trueis ignored. Turning on vLLM's response store would need a server setting, has memory and per-user drawbacks, and would be a separate issue under Add missing API endpoints #128 if anyone needs it.Changes
frontend/app/api/public/v1/deployment/[deploymentId]/responses/route.ts: the new route, a thin wrapper like the embeddings one. Its header comment explains the stateless limits.frontend/lib/public-deployment-proxy.ts:'responses'added toPublicDeploymentEndpoint. The security note now states that the caller's LLMHub key is never forwarded; only the deployment's vLLM key is.frontend/tests/unit/public-responses-route.test.ts: 10 tests.CHANGELOG.md: an entry under[Unreleased] → Added.Testing
Automated: vitest 110 passed (10 new),
tscclean, eslint no errors. The new tests cover the same auth and proxy cases as the embeddings route, plus:llmhub_key isn't;previous_response_idreaches the caller (the mock uses vLLM's real error body, from_make_not_found_error).Live on staging, 2026-11-04 (Delta, impersonate mode; staging on
mainat0b1bcb7with this branch's changes, frontend rebuilt). Qwen2.5-0.5B-Instruct deployment7c619a0e, launched from the UI, called through the new route with anllmhub_key:completed: "Hello! How can I assist you today?""stream": trueresponse.created,in_progress, 14 ×output_text.delta, …,response.completedcompleted: "Your name is Ada."previous_response_idThe successful requests also confirm the deployment's vLLM key is sent: the deployment was launched with one, and vLLM refuses requests without it.
Not covered:
vllm/entrypoints/openai/responses/), and this change doesn't depend on the cluster. A quickcurlon DeltaAI dev after deploy would confirm it.How to test
1. Unit tests, from
frontend/:pnpm test tests/unit/public-responses-route.test.ts2. Deploy the branch to staging (Delta VM, as the service account; check nobody else is using staging first):
K=/projects/bfmz/svcdeltallmhub/llmhub-staging/LLMHub/infra/delta/llmhub $K deploy --profile staging --ref 127-responses-endpoint --apply3. Launch a small model (e.g. Qwen2.5-0.5B-Instruct) from the UI, wait for Running, and copy its deployment ID and an API key from the API dialog. Then, with
U=http://127.0.0.1:3100/api/public/v1/deployment/<deployment id>/responsesandKEY=llmhub_…:🤖 Generated with Claude Code