TensaHub › Ollama (local)

Ollama (local)

Free local execution on your machine. curl, Python and JavaScript samples, live testing.

Test and rate in the catalog

Type
Provider
Provider
Ollama (local)
Pricing
Free
Keyless access
No
Base URL (OpenAI-compatible)
http://localhost:11434/v1
Inputs
Text
Developer rating
Not rated yet
Documentation
https://ollama.com
Last check
2026-12-04T20:19:49+00:00

Code samples

cURL

curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{"model":"MODEL_NAME","messages":[{"role":"user","content":"Hello, introduce yourself in one sentence."}]}'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1", api_key=os.environ["API_KEY"])
r = client.chat.completions.create(
    model="MODEL_NAME",
    messages=[{"role": "user", "content": "Hello, introduce yourself in one sentence."}],
)
print(r.choices[0].message.content)

JavaScript

// npm install openai
import OpenAI from 'openai'

const client = new OpenAI({ baseURL: 'http://localhost:11434/v1', apiKey: process.env.API_KEY })
const r = await client.chat.completions.create({
  model: 'MODEL_NAME',
  messages: [{ role: 'user', content: 'Hello, introduce yourself in one sentence.' }],
})
console.log(r.choices[0].message.content)

Popular searches

Frequently asked questions

Is the Ollama (local) API free?

Yes: Ollama (local) can be used for free with an API key, within the provider’s rate limits.

How do I call Ollama (local) from my code?

Ollama (local) exposes an OpenAI-compatible API at http://localhost:11434/v1: use any OpenAI SDK (Python, JavaScript…) with this base URL. Ready-to-use code (streaming, JSON, retries) is available in the developer toolkit.