Temperature controls how predictable or varied a language model’s responses are. The model scores possible next tokens—pieces of text—and chooses one at each step. Temperature changes how strongly that choice favors the highest-scoring option. section 13.3.1
Try three settings with the same prompt:
- 0.0 favors the highest-probability token at each step. Replies tend to be predictable, but this does not guarantee accuracy or safety. section 13.3.1
- 0.7 sometimes selects less-probable but reasonable tokens. It is a starting point for natural, varied replies; defaults differ by model and runtime. section 13.3.1
- 1.5–2.0 makes unusual choices more likely. Replies can be inventive, but also incoherent. section 13.3.1
One writing prompt, three results
A sunset description moves from straightforward at 0.0, to vivid at 0.7, to surreal at 1.5. Change only temperature to see how word choice shifts. section 13.3.1
Temperature does not set the assistant’s personality: a system prompt guides its behavior and presentation. Start by adjusting temperature alone; top_k, top_p, and repeat_penalty offer finer control when needed. section 13.3 section 13.3.1
model_names = [model["name"] for model in ollama_models]
model_labels = {model["name"]: model["label"] for model in ollama_models}
llm_model = st.selectbox(
"LLM Model (Ollama)",
model_names,
index=selected_model_index,
format_func=lambda name: model_labels.get(name, name),
)
whisper_label = st.selectbox("Whisper Model", list(WHISPER_MODELS.keys()))
whisper_model = WHISPER_MODELS[whisper_label]
temperature = st.slider("Temperature", min_value=0.0, max_value=2.0,
value=0.7, step=0.1)
A Streamlit slider lets users choose 0.0–2.0 in steps of 0.1, starting at 0.7. The selected value is passed to Ollama as a generation option. section 10.5.2
















