Skip to content

temperature & think: unintended consequences #157

@Mr-Ruben

Description

@Mr-Ruben

Reasoning models behavior (high-level)

Considering models with reasoning_model (or similar):

  • claude
  • gemini
  • chatgpt

Key difference:

  • claude → reasoning is strictly opt-in
  • gemini / chatgpt → reasoning cannot be turned off

Temperature handling in Lisette

In core.py:

  • Chat.__init__ hardcodes:

    temp = 0
  • Later, in _call / _call_async:

    temperature = None if think else ifnone(temp, self.temp)

So the actual behavior is:

  • If you do:

    chat = lisette.Chat(...)

    self.temp = 0

  • Then:

    • if think is active → temperature = None
    • otherwise → temperature = temp or self.temp0

So default = temperature 0 unless think is enabled


Why this matters (Gemini warning)

Logs showed:

21:57:20 - LiteLLM:INFO: vertex_and_google_ai_studio_gemini.py:886 - Warning: Setting temperature < 1.0 for Gemini 3 models (gemini-3.1-flash-lite-preview) can cause infinite loops, degraded reasoning performance, and failure on complex tasks. Strongly recommended to use temperature = 1.0 (default).

2026-04-24 21:57:20,803 - LiteLLM - INFO - Warning: Setting temperature < 1.0 for Gemini 3 models (gemini-3.1-flash-lite-preview) can cause infinite loops, degraded reasoning performance, and failure on complex tasks. Strongly recommended to use temperature = 1.0 (default).

Warning: Setting temperature < 1.0 for Gemini 3 models (gemini-3.1-flash-lite-preview) can cause infinite loops, degraded reasoning performance, and failure on complex tasks. Strongly recommended to use temperature = 1.0 (default).

Triggered by:

model = "gemini/gemini-3.1-flash-lite-preview"

chat = lisette.Chat(model=model)
response = chat("Just respond with OK.")

So:

  • No think
  • Default temp = 0
  • Gemini complains

Also: realistically, most people won’t read these logs.


Effort / thinking levels mismatch

Providers:

  • Anthropic → low, medium, high, max
  • Gemini / OpenAI → minimal, low, medium, high

Problem:

Lisette seems to expect only:

low / medium / high

Case: think="minimal"

response = chat("Just respond with OK.", think="minimal")

Raw log:

23:18:24 - LiteLLM:DEBUG: litellm_logging.py:1068 - 

POST Request Sent from LiteLLM:
curl -X POST \
https://generativelanguage.googleapis.com/v1alpha/models/gemini-3.1-flash-lite-preview:generateContent?key=*****M_uw \
-H 'Content-Type: application/json' \
-d '{'contents': [{'role': 'user', 'parts': [{'text': 'Just respond with OK.'}]}], 'generationConfig': {'temperature': 1.0, 'thinkingConfig': {'thinkingLevel': 'low'}}}'

Issue

  • minimal is not recognized
  • It is treated as None
  • Gemini default kicks in → thinkingLevel = low

So effectively:

minimal → ends up as default (low)


Control case: think="low"

response = chat("Just respond with OK (low).", think="low")

Raw log:

POST Request Sent from LiteLLM:
curl -X POST \
https://generativelanguage.googleapis.com/v1alpha/models/gemini-3.1-flash-lite-preview:generateContent?key=*****M_uw \
-H 'Content-Type: application/json' \
-d '{'contents': [{'role': 'user', 'parts': [{'text': 'Just respond with OK (low).'}]}], 'generationConfig': {'temperature': 1.0, 'thinkingConfig': {'thinkingLevel': 'low'}}}'

Issue

No issue — behaves as expected.


No think specified

response = chat("Just respond with OK. (no think)")

Raw log:

23:33:37 - LiteLLM:DEBUG: litellm_logging.py:1068 - 

POST Request Sent from LiteLLM:
curl -X POST \
https://generativelanguage.googleapis.com/v1alpha/models/gemini-3.1-flash-lite-preview:generateContent?key=*****M_uw \
-H 'Content-Type: application/json' \
-d '{'contents': [{'role': 'user', 'parts': [{'text': 'Just respond with OK. (no think)'}]}], 'generationConfig': {'temperature': 0, 'thinkingConfig': {'thinkingLevel': 'low'}}}'

Important clarification

  • thinkingLevel: low here is Gemini’s default

  • It happens because:

    • Lisette does not set a valid reasoning level
    • So reasoning_effort=None
    • Gemini defaults to "low"

Issue

  • Not setting thinktemperature = 0
  • This is the real problem (not the thinking level)

Summary of issues

  1. Default temperature = 0

    • Problematic for Gemini 3 models
    • Hidden unless logs are checked
  2. think affects temperature indirectly

    • think=Truetemperature=None
    • think=Falsetemperature=0
  3. minimal is not supported

    • Treated as None
    • Falls back to Gemini default (low)
  4. Gemini default reasoning can be misleading

    • thinkingLevel: low may appear even if you didn’t request it
    • This is not Lisette explicitly setting it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions