Skip to main content

Ollama best practices

Last updated 2 min read

Ollama identifies models as `name:tag`, and Coolhand treats each tag as a distinct model, so `llama3.1:8b` and `llama3.1:8b-instruct-q4_K_M` report separately. Standardize tags across your team or your cost and quality analytics will fragment across variants of the same underlying model.


Model naming

Ollama uses a name:tag format (e.g., llama3.1:8b, deepseek-r1:14b, qwen2.5:32b). Different tags for the same base model (e.g., llama3.1:8b vs llama3.1:8b-instruct-q4_K_M) appear as separate models in Coolhand. Standardize tags across your team to keep analytics meaningful.


Structured outputs

Supported via the format parameter. Pass a JSON schema to enforce structured output.

Docs: https://ollama.com/blog/structured-outputs


Caching

Not supported. Cached Input Tokens and Cache Creation Tokens will always be blank.


Batch processing

No batch API. A single Ollama instance handles concurrent requests in parallel via the OLLAMA_NUM_PARALLEL environment variable (default: 1). Raise it to process multiple requests simultaneously. Requests beyond the parallel limit are queued server-side up to OLLAMA_MAX_QUEUE (default: 512); Ollama returns HTTP 503 only when that queue is full. For higher throughput, increase OLLAMA_NUM_PARALLEL or run multiple instances behind a load balancer.


Latency

Reflects your local hardware and network, not a cloud provider's infrastructure. Expect more variability than hosted APIs, especially on consumer GPUs or CPU inference.


Reasoning tokens

Not supported. Reasoning Tokens will always be blank for Ollama logs, even for models that perform internal reasoning (e.g., DeepSeek-R1). Thinking content may appear in the Thinking Response field, but the token count is not broken out separately.


Cost tracking

Ollama has no per-token pricing — costs are your own compute. Coolhand captures token counts, but there is no dollar-cost mapping for Ollama logs.

Related articles

  • Azure OpenAI best practices

    Azure logs record your deployment name, not the underlying model version, so `my-gpt4o-prod` appears where you might ...

  • OpenRouter best practices

    OpenRouter model IDs are routing aliases in `provider/model` form, not provider-native names. Coolhand records the al...

  • AWS Bedrock best practices

    AWS Bedrock exposes two API surfaces and Coolhand records them as separate sources: `bedrock` for the OpenAI-compatib...

  • Google Gemini best practices

    The Gemini API carries system instructions in a top-level `system_instruction` field rather than a system-role messag...