Skip to content

Set explicit low temperature for chat completions (closes #103)#105

Open
vahid-ahmadi wants to merge 1 commit into
mainfrom
feat/explicit-chat-temperature
Open

Set explicit low temperature for chat completions (closes #103)#105
vahid-ahmadi wants to merge 1 commit into
mainfrom
feat/explicit-chat-temperature

Conversation

@vahid-ahmadi

Copy link
Copy Markdown
Collaborator

Set an explicit, low, env-overridable temperature on the main chat completion call so results are more consistent run-to-run.

The default is 0.0, overridable via the ANTHROPIC_CHAT_TEMPERATURE env var.

Honest caveat: temperature=0 does not guarantee bit-for-bit determinism from the API — it reduces variance, it doesn't eliminate it. The larger source of run-to-run inconsistency is the model generating variable run_python code; that's addressed separately by typed tools (#81) and reform recipes (#85). This is the cheap complementary lever.

Closes #103

🤖 Generated with Claude Code

Add CHAT_TEMPERATURE (env ANTHROPIC_CHAT_TEMPERATURE, default 0.0) and
pass it on the main streaming chat call. This is an analytical product
where numbers come from model-generated run_python code, so a low
temperature reduces run-to-run variance in the code the model writes.

Closes #103

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-uk-chat Ready Ready Preview, Comment Jun 8, 2026 9:22am

Request Review

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Beta preview is ready.

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.

Set an explicit temperature for chat completions to improve result consistency

1 participant