TOOL WIKI · MODELS & SERVING
Ollama
Runs supported models through a local model-management and serving interface.
Jump to a section 10 sections
EXAMPLE USE CASE
Run a policy-question baseline on a local model
An agent application needs a working model or inference-service boundary before adding retrieval, tools and production traffic.
- Input
- A pulled local model and a non-streaming request containing the policy.
- Expected output
- The answer returned by the loopback chat API.
- Success check: The configured inference route returns an answer using the supplied 30-day policy.
- Try a failure: An absent model or stopped server should surface as a setup error; unsupported facts must not be accepted as policy.
Example scope: Actual local inference; the sample does not add retrieval or tool execution.
Choose the model endpoint and send only the context required for this task.
inputTo 02 · OllamaLocal development and applications with a local inference requirement. Check tool calling and structured output support for the selected model.
Make the actual provider, weights, hardware, and supported API explicit.
resultTo 04 · Model responseValidate the returned structure and route proposed tools through application policy.
Capture failures, token use, queue time, and response latency.
outputTo 06 · EvaluationCompare the deployed model configuration against repeatable fixtures.
Result or stopping point
Local development and applications with a local inference requirement. Check tool calling and structured output support for the selected model.
When to consider it
- Local development and applications with a local inference requirement.
A design decision to make
- Check tool calling and structured output support for the selected model.
Prerequisites and setup
- Ollama installed/running and enough memory for the selected local model. The displayed 3B model is a fixed lab example.
python3 -m venv .venv
source .venv/bin/activate
pip install requests
export OLLAMA_MODEL="llama3.2:3b"
ollama pull "$OLLAMA_MODEL"Try a small integration
local.py
import os
import requests
response = requests.post("http://127.0.0.1:11434/api/chat",timeout=120,
json={"model":os.environ["OLLAMA_MODEL"],"stream":False,
"messages":[{"role":"user","content":"Policy: returns are accepted within 30 days. Can an item be returned after 20 days? Answer briefly using only this policy."}]})
response.raise_for_status()
print(response.json()["message"]["content"])Run and check the result
# Start the local Ollama service if the desktop app is not already serving.
ollama serve
# In another terminal:
python local.py- The configured inference route returns an answer using the supplied 30-day policy.
- stream=False yields one JSON response; streaming mode yields multiple events and needs an incremental parser.
Common failures
- A healthy HTTP server does not prove the model loaded or a request completed. Check model readiness and an actual response separately.
- Model identifiers, context length and supported parameters differ by backend; do not assume an OpenAI-compatible endpoint supports every API feature.
Production decisions
- Pin the model, tokenizer/chat template, runtime and request settings. Benchmark the actual workload for latency, memory, concurrency and quality.
- Keep model endpoints authenticated and scoped; cap request/output sizes, enforce deadlines and redact telemetry.
- Distinguish local and cloud model routes. Keep a local unauthenticated API on loopback unless an authenticated gateway protects it.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.