What it does
Run supported language models locally and expose a local API that can be used by scripts, applications and compatible developer tools.
The Ollama runtime loads a model on your machine.
Your application calls the native Ollama API or its documented OpenAI-compatible endpoint.
The runtime performs inference using local hardware and returns the result to the caller.
Who it may fit
Choose based on the workflow and trust boundary, not only the feature list.
Good fit for
- Private local experiments
- Offline-friendly development workflows
- Testing prompts and application contracts before choosing a hosted provider
Verify before using
- Model quality, latency and context depend on your hardware and the model you run.
- Local inference does not automatically solve retention, access control or shared-team operations.
- The OpenAI-compatible layer is documented as a compatibility subset; verify the features your application uses.
Setup outline
Use this as a mental checklist, then follow the official documentation for the current install and configuration details.
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1/",
api_key="ollama", # placeholder for the local API
)
response = client.chat.completions.create(
model="your-local-model",
messages=[{"role": "user", "content": "Say OK"}],
)
print(response.choices[0].message.content)Official sources
These links are the authority for current installation, capabilities, releases and security notices.
This editorial page was reviewed on 2026-09-26. Project details may change between reviews.
Related AI learning
Related AI tools
Want to understand the engineering trade-offs?
Use the AI learning paths for fundamentals, prompt design, agents, routing and safe development workflows.