RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /How-to
  5. /How to set temperature parameters for creative output
HOW-TO · INF

How to set temperature parameters for creative output

beginner·5 min·By Eruo Fredoline
PREREQUISITES

Ollama installed

What this does

Temperature controls the randomness of token selection. Higher values (0.7-1.0) produce more diverse and creative outputs, making them ideal for storytelling, brainstorming, and creative writing.

Steps

  1. Set temperature via Ollama command line.

    ollama run llama3.2
    /set parameter temperature 0.9
    

    Then prompt: "Write a fantasy story opening."

  2. Set temperature via the API.

    curl -s http://localhost:11434/api/generate \
      -d '{"model": "llama3.2", "prompt": "Write a poem about AI",
           "options": {"temperature": 0.8}, "stream": false}' \
      | jq -r '.response'
    
  3. Create a Modelfile for permanently creative defaults.

    FROM llama3.2
    PARAMETER temperature 0.85
    PARAMETER top_p 0.95
    
    ollama create creative-llama -f Modelfile
    
  4. Compare outputs at different temperatures.

    echo "=== Temperature 0.2 ==="
    curl -s ... -d '{"options":{"temperature":0.2}}' | jq -r '.response'
    echo "=== Temperature 0.9 ==="
    curl -s ... -d '{"options":{"temperature":0.9}}' | jq -r '.response'
    

    Expected: Low temperature produces predictable text; high temperature produces more varied word choices.

Verification

# Generate the same prompt 3 times at temperature 0.9
for i in 1 2 3; do
  curl -s http://localhost:11434/api/generate \
    -d '{"model":"llama3.2","prompt":"Name a fantasy kingdom","options":{"temperature":0.9},"stream":false}' \
    | jq -r '.response'
done
# Expected: Three different kingdom names (e.g., Eldoria, Drakemoor, Silvervale)

Common failures

  • Temperature too high causes gibberish: Values above 1.2 can produce incoherent output. Stay within 0.0-1.5.
  • Temperature too low for creativity: Values below 0.5 restrict word choice. For creative tasks, use 0.8-1.0.
  • Perplexity increase with high temperature: Higher temperature = more surprising words. For plausible creativity, combine with top_p: 0.9.

Operator checkpoint

Before treating this as solved, write down the local runtime, model or package version, hardware/backend if relevant, and the verification output. This keeps the guide useful as a Will-It-Run style decision instead of a one-off command transcript.

Related guides

  • How to set temperature to zero for deterministic responses
  • How to tune temperature based on task type
RELATED GUIDES
INF
How to tune temperature based on task type
INF
How to set temperature to zero for deterministic responses
← All how-to guidesCourses →