Skip to content

fix(delegate): omit temperature when the model's compat.supportsTemperature is false - #31

Open
skylerwshaw wants to merge 1 commit into
getpipher:mainfrom
skylerwshaw:fix/omit-temperature-when-unsupported
Open

skylerwshaw wants to merge 1 commit into
getpipher:mainfrom
skylerwshaw:fix/omit-temperature-when-unsupported

Conversation

@skylerwshaw

Copy link
Copy Markdown

Fixes #30

callVisionModel always sent temperature: 0, so models that reject an explicit temperature (for example Claude Haiku 5.5) failed every describe_image call with a 400.

pi-ai already marks those models compat.supportsTemperature: false and defaults the flag to true. This reads the same flag and omits temperature when it is false. Every other model still gets temperature: 0.

Testing

  • New test: callVisionModel: omits temperature when model.compat.supportsTemperature is false. It fails without the change.
  • pnpm typecheck clean, pnpm test:run 355/355.

Note on open PRs

#27 rewrites the delegate to dispatch on model.api and drops temperature for its Anthropic and Responses branches, but its chat-completions and Gemini branches still hardcode temperature: 0. This change is small and should rebase onto #27 easily if that one lands first.

…rature is false

callVisionModel always sent temperature: 0. Models that reject an explicit
temperature, such as Claude Haiku 5.5 (via LiteLLM: "does not support
temperature=0. Only temperature=1 is supported"), failed every
describe_image call with a 400.

pi-ai already records this as compat.supportsTemperature: false on those
models and defaults it to true. Read the same flag here and leave
temperature out when it is false; other models keep temperature: 0.
@skylerwshaw
skylerwshaw marked this pull request as ready for review October 21, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

describe_image fails for models that reject temperature (compat.supportsTemperature: false)

1 participant