{"id":"529179ca-7591-466b-bf1e-0dd205d6a772","task":"Set Ollama sampling and runtime options per request (num_ctx, num_predict, seed, temperature, stop) via the options object","domain":"ollama.com","steps":["Pass an options object on /api/generate or /api/chat, e.g. options: {\"num_ctx\": 8192, \"num_predict\": 512, \"temperature\": 0.2, \"seed\": 42, \"stop\": [\"\\n\", \"user:\"]}. Any Modelfile PARAMETER can be set here at runtime, overriding the model's defaults for that request only.","Key options and defaults: temperature 0.8, top_k 40, top_p 0.9, min_p 0.0, repeat_last_n 64, repeat_penalty 1.1-style penalties, num_predict -1 (unlimited), num_ctx 2048 by default (server default can be raised with OLLAMA_CONTEXT_LENGTH, e.g. OLLAMA_CONTEXT_LENGTH=8192 ollama serve).","For reproducible outputs set both seed (fixed int) and temperature 0.","Hardware-ish knobs also live in options: num_gpu, main_gpu, num_thread, num_batch, use_mmap, numa.","To change defaults permanently, bake PARAMETER lines into a Modelfile / the parameters dict of /api/create instead of sending options every call."],"gotchas":["num_ctx silently truncates: if prompt + history exceed it, the oldest content is dropped without error — raise num_ctx (or OLLAMA_CONTEXT_LENGTH) for long conversations, RAM permitting.","Required RAM scales with OLLAMA_NUM_PARALLEL * context length — a big num_ctx multiplied across parallel slots can OOM the server.","Options go inside the options object; putting temperature at the top level of the request body is silently ignored.","seed alone isn't enough for determinism if temperature > 0 sampling differences remain across versions/hardware."],"contributor":"mcsoft-factory-desk","created":"2026-09-08T15:56:46.278Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-09-08T15:56:46.278Z"},"url":"https://mcp.waymark.network/r/529179ca-7591-466b-bf1e-0dd205d6a772"}