协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
check-api-compat【开发与工程】Determine the correct behavior of vLLM's OpenAI-compatible or Anthropic-compatible API by checking the official upstream spec, instead of guessing from vLLM's own code. Use for any bug, issue, PR, review, or question touching /v1/chat/completions, /v1/completions, /v1/responses, /v1/embeddings, /v1/messages, or their request/response models — includi…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
vLLM's OpenAI and Anthropic server surfaces are reimplementations of someone else's spec. vLLM's own code, tests, and docstrings are not evidence of correct behavior — they are the thing under test. Establish what upstream says first, then compare.
Never answer "what should this field do" from memory. Field names, types, and especially defaults drift between spec versions.
Name three things before looking anything up:
In a vLLM checkout, the request/response models live beside each endpoint:
| surface | path |
|---|---|
| OpenAI chat | vllm/entrypoints/openai/chat_completion/ |
| OpenAI completions | vllm/entrypoints/openai/completion/ |
| OpenAI responses | vllm/entrypoints/openai/responses/ |
| OpenAI embeddings | vllm/entrypoints/pooling/embed/ |
| OpenAI shared base models, errors, usage | vllm/entrypoints/serve/engine/protocol.py |
| Anthropic messages | vllm/entrypoints/anthropic/ |
| audio | vllm/entrypoints/speech_to_text/*/protocol.py |
Each directory holds protocol.py (the Pydantic models), serving.py (behavior),
and api_router.py (routing and status codes). Read the field declaration and
the code that consumes it — a field can be declared faithfully and then ignored,
which is still an incompatibility.
Prefer a source that can actually be read as text, in this order.
https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yamlopenai Python SDK's typed params, which track the spec closely.
Locate them with python -c "import openai,os;print(os.path.dirname(openai.__file__))",
then read e.g. types/chat/completion_create_params.py,
types/chat/chat_completion.py, types/chat/chat_completion_chunk.py,
types/responses/. Note the SDK version — an old SDK is an old spec.https://platform.openai.com/docs/api-reference/...
for semantics the types do not carry. It is script-heavy and often fetches
poorly; treat a failed fetch as a fetch failure, not as absence of a field.https://docs.claude.com/en/api/messages and
https://docs.claude.com/en/api/messages-streaming — these render as clean
text and are the primary source for both fields and streaming event order.anthropic SDK's types/message_create_params.py,
types/message.py, types/raw_message_stream_event.py.Say which source and which version answered the question, so the finding can be re-checked later.
A field is compatible only when name, type, default, and semantics all match. Most real bugs hide in the last two: a field that exists with the right type but the wrong default, or one that is accepted and silently dropped.
Also check, when relevant:
data: [DONE] for Chat Completions and Completions; response.completed,
response.failed, or response.incomplete with no [DONE] for Responses;
message_stop for Anthropic).type/code strings.null. Pydantic defaults erase that distinction unless the model is
written to preserve it.Three outcomes, and they are not the same:
vllm_xargs,
chat_template_kwargs, sampling knobs like min_p). These are intentional and
allowed. Do not report them as violations. Check per surface: top_k is an
extension on OpenAI but a real upstream field on Anthropic Messages.An unsupported-but-declared field is its own subcase: decide whether vLLM rejects it explicitly or accepts and ignores it, and report which, since silently ignoring a documented field is the more damaging failure.
State: the endpoint and field, what upstream specifies (with the source), what
vLLM does (with file:line), which of the three outcomes it is, and the smallest
fix. When behavior turns on a spec detail that is easy to disbelieve, quote the
upstream line rather than paraphrasing it.