Skip to content

Pinned model silently fails over to another provider and model; opt-out undocumented and no marker #128

Closed

Description

@stackbilt-admin

Problem

A request that pins a Cloudflare model can be served by a different provider and a different model by default, and nothing beyond the final provider/model fields marks the substitution.

Measured (@stackbilt/[email protected], local workerd, fake AI binding that throws a 500, fake fetch; no live calls)

const llm = new LLMProviders({
  cloudflare: { ai, maxRetries: 0 },
  groq: { apiKey: 'x', maxRetries: 0 },
  stateScope: 'client',
});
await llm.generateResponse({ model: '@cf/zai-org/glm-5.3-flash', messages, maxTokens: 10 });
Config Result
default served by groq / llama-3.3-70b-versatile; response metadata keys were only systemFingerprint, created
fallbackRules: [] throws; no HTTP call made

A generic Error was used for the binding failure, so other error classes may take a different path.

Why it matters

For an application with a per-task model allowlist, a pin looks like a guarantee. A substituted model can differ in quality and capability, and the request content goes to a different vendor, which matters for privacy-scoped data. A caller can detect it only by comparing response.model with what it asked for.

Expected

  • Document that a pin isn't a hard constraint, and document fallbackRules: [] as the opt-out. I found it by testing; I didn't find it described for this purpose.
  • Mark substitutions in the response, for example by populating the canonical routing.fallbackChain or a metadata.fallback field.
  • Consider a per-request option such as allowFallback: false or allowedRoutes, since one client often serves tasks with different policies.

Relationship to existing issues

Touches the pinned-model and fallback-enforcement items in #113 and the roadmap in #118. Filed separately because the default behavior, the opt-out documentation and the missing marker can be handled on their own.

Activity

  1. added
    enhancement
    P2-medium
    on Oct 31, 2026
  2. added a commit that references this issue on Nov 6, 2026
    0a2dae1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions