Groq route intermittently returns json_validate_failed with strict structured outputs

Hi Hugging Face team,

We are seeing reproducible HTTP 400 failures through Hugging Face Inference Providers on the exact route:

openai/gpt-oss-20b:groq

The workload uses strict structured outputs for a deterministic entity-matching classification. The inputs are public and non-personal. We ran bounded diagnostics without retries, prompt tuning, or fixture changes.

Failure fingerprint

Every failed call returned:

  • HTTP 400
  • invalid_request_error
  • json_validate_failed
  • structured_generation_failed

Normal-schema targeted diagnostic

Five repetitions per conservative review fixture:

  • entity-review-01: 0/5 successful
  • entity-review-02: 1/5 successful

The one successful response matched the expected decision and confidence exactly. The same 188-byte strict output schema succeeded on a comparator. Request sizes were similar, so schema shape and request size do not explain the fixture-specific failures.

Failed request IDs for entity-review-01:

  • req_01m0jacw8zemabfp437wn7hdt8
  • req_01m0jacwxjeeva9k8rd84gc3pj
  • req_01m0jacxdne98r2akb1janc4w8
  • req_01m0jacy5qep39padbzhy7tzsp
  • req_01m0jacyw4eqvrhwd1p4b0pfak

Failed request IDs for entity-review-02:

  • req_01m0jad0rvedvva48h0mg0h4qk
  • req_01m0jad1dse1zsj83nvcjb40yd
  • req_01m0jad2fcexc89hmwe2p34arb
  • req_01m0jad329en9s172f1vrcqrvg

Forced-singleton-schema isolation

We then kept the prompt and inputs unchanged but replaced the response schema in memory with singleton enums requiring the already-checked output: match=review, confidence=low.

Results across three repetitions per fixture:

  • entity-review-01: 3/3 successful
  • entity-review-02: 2/3 successful

The remaining failure had the same fingerprint even though the model had no enum choice:

  • req_01m0jzsav8e71rdt2j9qc4k27m

This suggests enum selection contributes materially, but does not fully explain the route-level structured-generation failures.

Could you please confirm:

  1. Whether these request IDs reached Groq and where json_validate_failed originated (HF router validation, provider validation, or generation)?
  2. Whether openai/gpt-oss-20b:groq has a known reliability limitation with strict JSON-schema outputs?
  3. Whether there is a supported request/schema adjustment that preserves strict structured output semantics?

Reproduction record

The evidence is stored in a private repository, so the complete reproducible record is included here instead of linking to inaccessible CI pages.

Normal-schema targeted diagnostic:

  • Repository revision: 95c970d8f66979413bed18b680b86cfeeeec8780
  • Workflow run: 32490428886
  • Redacted report artifact: hf-benchmark-report-32490428886 (artifact 9449532403)
  • Artifact digest: sha256:c04babef1bb956d0b6f3633887521fbe6583d1e805bd85407dd998250ba1d7ef
  • Report version: 1.3.0
  • Ten calls: five repetitions for each fixture
  • Estimated cost: 137 micro-USD
  • Successful-call latency: 903 ms

Forced-singleton-schema diagnostic:

  • Repository revision: 49ea63697f5afb82cccad93294ed858770c93232
  • Workflow run: 32523118374
  • Redacted report artifact: hf-benchmark-report-32523118374 (artifact 9461257213)
  • Artifact digest: sha256:da529cd0ef0fd601b9cae7dc948b72acdc6d3ce1ccf5be3f3ce1ffc0a486a769
  • Report version: 1.4.0
  • Six calls: three repetitions for each fixture
  • Estimated cost: 532 micro-USD
  • Successful-call latency range: 309–515 ms; p95: 515 ms

Both diagnostics used the same policy (phase-12-2-hugging-face-public-evaluation-v1), registry (hugging-face-structured-evaluation@1.1.0), and fixtures (public-business-controlled-ai-v1@1.0.0). Raw prompts, inputs, outputs, provider messages, failed generations, and credentials were not retained. Authority leakage was zero.

For now, I only tried a few requests through Inference Providers:


A few things seem clearer to me after comparing your results with the current Groq/HF behavior.

First, your req_01... IDs look quite consistent with Groq-side request IDs. I cannot prove that each original request reached Groq without knowing exactly which response field/header those IDs came from, or without a provider-side trace. But in a small current HF Inference Providers → Groq test, the HTTP x-request-id and the response body’s x_groq.id were identical on every request, and both had the same req_01... form. Groq’s API reference also documents x_groq as Groq-specific response metadata and shows IDs in that form.

So, for your first question, I would currently phrase it roughly as:

those IDs are strongly consistent with Groq-side request IDs, but staff/provider tracing would still be needed to establish the provenance of the original requests conclusively.

Second, I do not think the observed json_validate_failed should simply be treated as normal behavior of current strict: true. Groq’s current Structured Outputs documentation lists both openai/gpt-oss-20b and openai/gpt-oss-120b as supporting strict mode via constrained decoding, and describes strict mode as guaranteeing schema adherence. The same page explicitly asks for repros if strict mode produces 400 errors.

There are also public reports of superficially similar gpt-oss-20b + strict failures on direct Groq, for example this Groq Community report. I would not assume it has the same root cause as yours, though.

For the workaround question, I did not find a documented “change X and strict becomes reliable” workaround that I would be comfortable recommending. Retrying may be a practical mitigation for a transient error, and 120B could be an interesting comparison, but neither explains a failure of the strict contract.

The lowest-cost/highest-information next step, if this happens naturally again, may simply be to preserve one failed response in more detail, rather than running another large batch.

In particular, these would be useful together:

failed_generation
x-request-id / x_groq.id
system_fingerprint
x-groq-region
endpoint + client/library version
explicit max_completion_tokens / reasoning settings
exact schema, or at least a stable schema hash

I would put failed_generation, the request ID, and system_fingerprint at the top of that list.

json_validate_failed by itself seems too coarse to tell us what actually failed: a bad enum value, malformed JSON, an output-budget problem, or some other generation/validation path can all look similar from the outside.

One small qualification on the singleton test: I think it is a useful differential, but I would be a little cautious about interpreting the improvement specifically as semantic enum selection being isolated.

Changing

normal enum -> singleton enum

changes several things at once:

semantic choices
allowed output strings
constrained language / grammar state space
token-mask search space

So I think the strongest observation is:

shrinking the allowed output space materially changed the observed failure rate.

The fact that one singleton request still failed also seems important, because semantic selection among multiple enum values cannot by itself explain that remaining failure.

Small current HF → Groq control I tried

I used the current Hugging Face Inference Providers OpenAI-compatible route documented in the HF Groq provider guide:

https://router.huggingface.co/v1/chat/completions
model = openai/gpt-oss-20b:groq

I used two synthetic fixtures and alternated two strict schemas:

normal:
  match      ∈ {match, review, no_match}
  confidence ∈ {low, medium, high}

singleton:
  match      ∈ {review}
  confidence ∈ {low}

Both were closed objects with all properties required and additionalProperties: false, following the current Groq strict-mode requirements.

The compact schemas were roughly the same scale as the one mentioned in your report:

normal     ~220 bytes
singleton  ~185 bytes

The calls were sequential, with no retry logic, and I kept the synthetic semantic target fixed at:

{"match":"review","confidence":"low"}

Result:

condition result
normal enum 6 / 6 HTTP success
singleton enum 6 / 6 HTTP success
locally schema-valid output 12 / 12
expected synthetic semantic value 12 / 12
failed_generation observed 0 / 12

So I could not reproduce the normal-vs-singleton reliability difference in this small current control.

I do not think that contradicts your report. This was deliberately not an attempted reconstruction of your private workload: different prompt/input, not necessarily the same exact schema, a later backend state, only 12 structured requests, and I only tested through Inference Providers rather than doing a separate direct-Groq run.

What I think the negative result does tell us is narrower:

  • gpt-oss-20b + Groq + strict:true is not failing universally at the moment;
  • a small multi-value enum is not by itself sufficient to trigger the problem;
  • a roughly ~200-byte schema is not by itself sufficient;
  • reasoning being present is not by itself sufficient;
  • the failure may therefore depend on some combination of the exact workload, exact schema/request serialization, request parameters, backend state, or an intermittent serving/validation path.

One other thing was useful in this control.

For all 12 successful routed calls:

HTTP x-request-id == response x_groq.id

and they were all req_01... IDs.

That is why your recorded IDs now look fairly Groq-like to me even though I would still leave the final attribution to the trace data.

The successful calls also returned multiple system_fingerprint values. Groq defines system_fingerprint in its API reference as identifying the backend configuration on which the model ran.

I would therefore not treat fingerprint variation itself as suspicious; multiple fingerprints worked correctly in this tiny control. But if future failures cluster on one fingerprint while nearby successful requests do not, that would be a much more useful correlation to hand to HF/Groq.

How I would interpret one future failure

If another failure appears during normal use, the raw failed_generation could separate several branches without requiring another large experiment.

new strict failure
|
+-- failed_generation contains schema-invalid JSON / enum value
|      -> constrained-generation / validation path becomes more interesting
|
+-- failed_generation says output/completion budget was exhausted
|      -> max_completion_tokens / reasoning-budget branch
|
+-- free text or protocol text appears around the JSON
|      -> format / constraint-activation / serving-path branch
|
+-- useful failed generation is absent, but request ID + fingerprint exist
|      -> provider trace / backend-correlation branch
|
+-- failures repeatedly correlate with one fingerprint or region
       -> useful correlation to report, but not yet proof of causality

That separation also keeps two different questions apart:

Did the model choose the semantically correct class?

versus

Did strict structured generation satisfy its schema contract?

A strict decoder can guarantee the latter without guaranteeing that the chosen legal enum value is semantically correct. Conversely, an HTTP/schema-generation failure should not automatically be scored as a semantic classification mistake.

So my current read would be:

  1. The request IDs look much more like Groq-side IDs than generic HF router IDs, although the original provenance still needs tracing to be certain.
  2. The observed strict validation failures do not look like documented normal strict-mode behavior under Groq’s current contract.
  3. I could not reproduce the issue in a small current synthetic HF → Groq control, including with a normal multi-value enum.
  4. Your singleton control still looks informative, but I would interpret it as changing the allowed constrained-output space, not as isolating semantic enum selection alone.
  5. I do not see a verified strict-preserving workaround yet.
  6. If it occurs again, capturing one raw failure with failed_generation + request ID + system_fingerprint may be more informative than another large repetition run.

That would also give HF/Groq staff something fairly compact to correlate against their side without requiring you to expose the original entity data.