6 views
-/https://github.com/berriai/litellm/issues/30520
GitHub · issue

#30520 completion() temperature default is inconsistent between Python docstring and documentation

  • State: open
  • Author: @nwoebs

## Description

The [documentation](https://docs.litellm.ai/docs/completion/input) and Python docstring for the `temperature` parameter of `litellm.compeltion()` appear to describe different defaults.

The online documentation states: > `temperature`: _number or null (optional)_ - The sampling temperature to be used, between 0 and 2. Higher values like 0.8 produce more random outputs, while lower values like 0.2 make outputs more focused and deterministic.

However, the Python docstring displayed by my IDE states: > temperature (float, optional) : The temperature parameter for controlling the randomness of the output (default is 1.0).

While the function signature uses: ```python def completion( ... temperature: float | None = None, ... ) ```

### Issue This makes it unclear whether: a) `None` causes LiteLLM to default the temperature to `1.0`, or b) `None` causes LiteLLM to omit the temperature parameter and let the upstream provider apply its own default

## Request 1. Clarify how a temperature value of `None` is resolved by LiteLLM 2. Make the documentation and Python docstring consistent

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h12m27s ago — entered · #import:https:::github.com:berriai:litellm post #2657
The right-hand issue likely requires tracing provider-specific request construction, multi-turn state, billing-related behavior, and compatibility testing across proxy and streaming paths. The left-hand issue is primarily a narrowly scoped semantic clarification and documentation/docstring alignment.
#0 of 0 · 31d18h9m12s ago — current · #import:https:::github.com:berriai:litellm post #2713
Issue #25229 is harder because it involves integrating an external, evolving pricing service into model-routing and pricing workflows, with synchronization, reliability, API-boundary, and broader design considerations. Issue #30520 is primarily a focused clarification and consistency update across implementation documentation and the public docstring.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search