You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live Workers AI responses with reasoning: null fail with SchemaDriftError, making Llama 3.3 fp8-fast unusable #130
A real Workers AI response from @cf/meta/llama-3.3-70b-instruct-fp8-fast fails the package's envelope validation, so a valid completion becomes an error:
SchemaDriftError: Response schema drift at choices[0].message.reasoning: expected string, got null
Reproduction
@stackbilt/[email protected], in a deployed Worker with a real AI binding, on 2026-10-31:
constllm=newLLMProviders({cloudflare: {ai: env.AI,maxRetries: 0},fallbackRules: [],stateScope: 'client',});awaitllm.generateResponse({model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',maxTokens: 20,temperature: 0,messages: [{role: 'user',content: 'Reply with the word ready.'}],});
In the same run, @cf/zai-org/glm-5.3-flash and @cf/openai/gpt-oss-20b succeeded.
It looks like optional accepts a missing field but not an explicit null, and Workers AI appears to return null for models with no reasoning. I inferred this from the error text and the schema, and did not capture the raw response.
Why it matters
The catalog lists this model as active, and routes it for cost-effective, balanced, high-performance, and tool-calling use. It's also on Cloudflare's JSON mode list. With other providers configured, the failure would presumably trigger fallback, which hides it and may send the request to another vendor. With fallback off, the model can't be used.
Expected
Treat null as absent for optional response fields, and add a live-shaped fixture for this response. Other OpenAI-compatible adapters with the same field may need the same check.
Scope
One deployed call on each of three models. Mocked tests can't show this, since they don't reproduce the live response shape. Our project recorded it as an M2 finding and is evaluating the other two models for now.
Activity
chore: release v1.24.1 (#141)
fix: accept null Cloudflare reasoning fields (Stackbilt-dev#134)