Layr-Labs / Layr-Labs/d-inference
/v1/responses silently drops the top-level instructions field (all models)
- Dominant language
- Go
- Stars
- 522
- Forks
- 113
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 111
Description
## `/v1/responses` silently drops the top-level `instructions` field (all models)
The Responses API accepts the `instructions` field without error but the model never receives it. System-role items passed inside `input` ARE honored, as are `system` messages on `/v1/chat/completions` — so the bug is isolated to the `instructions` field itself (it appears to never be merged during prompt assembly).
This breaks any OpenAI-SDK/Responses-based client that sends its system prompt the standard way: agents run with no system prompt at all, and the failure is silent — no error, just a model that introduces itself as "Gemma 4 by Google DeepMind" and ignores every behavioral instruction.
Verified 2026-08-25 against `api.darkbloom.dev` on both `gemma-4-26b` and `qwen3.6-35b-a3b-vl-mtp-mxfp8`.
### Repro 1 — `instructions` field: IGNORED
```bash
curl -s https://api.darkbloom.dev/v1/responses \
-H "Authorization: Bearer $DARKBLOOM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemma-4-26b",
"instructions": "Begin every reply with the word XYZZY and answer only in French.",
"input": [{"role":"user","content":[{"type":"input_text","text":"hi! what can you help me with?"}]}],
"store": false
}'
```
**Expected:** reply starts with `XYZZY`, in French.
**Actual:** `Hello! I am Gemma 4, a large language model developed by Google DeepMind. I can assist you with a wide variet…` — English, no XYZZY, instructions completely absent from the model's context. Reproducible across runs and prompts; identical behavior with `qwen3.6-35b-a3b-vl-mtp-mxfp8`.
### Repro 2 — same instruction as a system item in `input`: HONORED
```bash
curl -s https://api.darkbloom.dev/v1/responses \
-H "Authorization: Bearer $DARKBLOOM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemma-4-26b",
"input": [
{"role":"system","content":[{"type":"input_text","text":"Begin every reply with the word XYZZY and answer only in French."}]},
{"role":"user","content":[{"type":"input_text","text":"hi! what can you help me with?"}]}
],
"store": false
}'
```
**Actual:** `XYZZY Je peux vous aider avec une grande variété de tâches…` — correct.
### Repro 3 — control via `/v1/chat/completions`: HONORED
```bash
curl -s https://api.darkbloom.dev/v1/chat/completions \
-H "Authorization: Bearer $DARKBLOOM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemma-4-26b",
"messages": [
{"role":"system","content":"Begin every reply with the word XYZZY and answer only in French."},
{"role":"user","content":"hi! what can you help me with?"}
]
}'
```
**Actual:** `XYZZY Je peux vous aider…` — correct.
### Suggested fix
Merge `instructions` into the rendered prompt as the leading system message during Responses request assembly (equivalent to prepending a system item to `input`), matching OpenAI's documented semantics: "instructions … is inserted into the model's context [ahead of] the input".
Contributor guide
Research direction
Start at the Responses request assembly and prompt-rendering path for /v1/responses, using the provided curl examples to trace where the top-level instructions field is lost. Verify the change against gemma-4-26b or qwen3.6-35b-a3b-vl-mtp-mxfp8: instructions should behave like a leading system item, while the existing input and chat completions behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100