ericrisco/rsc-harness / skills/ollama
ollama
VerifiedUse when running open-weight LLMs locally with Ollama — pulling and tagging models, calling the local API, picking a quantization or GGUF, writing Modelfiles, and sizing VRAM and RAM for the machine at hand. NOT remote or managed GPU serving and autoscaling (that is `runpod`), NOT downloading raw weights or datasets (that is `huggingface`), NOT retrieval pipeline design (that is `rag`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.2 KB |
| evals/README.md | markdown | 714 B |
| evals/cases.yaml | config | 3.0 KB |
| references/api.md | markdown | 5.1 KB |
| references/hardware-sizing.md | markdown | 4.0 KB |
| scripts/verify.shexecutable | script | 4.8 KB |
references/api.md
View on GitHub# Ollama local API reference
Daemon base URL: `http://localhost:11434`. Bind elsewhere with `OLLAMA_HOST=0.0.0.0:11434`.
Two surfaces share the daemon: the **native** API (`/api/*`) and the **OpenAI-compatible** layer
(`/v1/*`).
## Native endpoint catalog
| Method | Path | Purpose |
| --- | --- | --- |
| POST | `/api/generate` | single-turn completion (`prompt`) |
| POST | `/api/chat` | multi-turn chat (`messages`); supports `tools`, `images`, `think` |
| POST | `/api/embed` | embeddings (`input` string or array); legacy alias `/api/embeddings` |
| POST | `/api/create` | create a model from a Modelfile / quantize |
| POST | `/api/pull` | download a model |
| POST | `/api/push` | upload a model |
| POST | `/api/show` | model template, params, context length, quant |
| POST | `/api/copy` | duplicate a model under a new name |
| DELETE | `/api/delete` | remove a model |
| GET | `/api/tags` | models on disk (≈ `ollama list`) |
| GET | `/api/ps` | models loaded in memory (≈ `ollama ps`) |
| GET | `/api/version` | daemon version |
## Request fields (generate / chat)
| Field | Type | Default | Notes |
| --- | --- | --- | --- |
| `model` | string | — | **required**; a pulled tag |
| `prompt` | string | — | `/api/generate` only |
| `messages` | array | — | `/api/chat`; `{role, content, images?, tool_calls?}` |
| `stream` | bool | `true` | NDJSON stream; set `false` for a single object |
| `format` | string \| object | — | `"json"` or a JSON Schema object to constrain output |
| `options` | object | — | runtime params: `temperature`, `num_ctx`, `top_p`, `seed`, `num_predict`, `stop`, … |
| `keep_alive` | string \| int | `"5m"` | how long to keep loaded; `0` unloads now, `-1` keeps forever |
| `tools` | array | — | tool/function definitions for tool calling |
| `images` | array | — | base64 images for multimodal models |
| `think` | bool | — | enable/disable reasoning on models that support it |
`options.num_ctx` is per-request and does not persist. Bake a permanent context window into a
Modelfile with `PARAMETER num_ctx`.
## Response fields
Final object (streaming or not) carries: `done` (bool), `done_reason`, `total_duration`,
`load_duration`, `prompt_eval_count`, `prompt_eval_duration`, `eval_count`, `eval_duration`.
Tokens/sec ≈ `eval_count / (eval_duration / 1e9)`.
Streaming = NDJSON: one JSON object per line; accumulate `message.content` (chat) or `response`
(generate) until `done: true`.
```python
import requests, json
with requests.post("http://localhost:11434/api/chat",
json={"model": "qwen3:8b",
"messages": [{"role": "user", "content": "Count to 3."}]},
stream=True) as r:
for line in r.iter_lines():
if line:
obj = json.loads(line)
print(obj.get("message", {}).get("content", ""), end="", flush=True)
if obj.get("done"):
break
```
## Structured output via `format`
Pass a JSON Schema as `format`; the model is constrained to emit conforming JSON. Pair with a low
temperature and an explicit instruction to return JSON.
```bash
curl http://localhost:11434/api/chat -d '{
"model": "qwen3:8b",
"messages": [{"role": "user", "content": "List two EU capitals as JSON."}],
"stream": false,
"options": {"temperature": 0},
"format": {
"type": "object",
"properties": {
"capitals": {"type": "array", "items": {"type": "string"}}
},
"required": ["capitals"]
}
}'
```
## Tool calling
Define `tools`; the response may contain `message.tool_calls`. Execute the tool, append a
`{"role": "tool", "content": "<result>"}` message, and call again.
```bash
curl http://localhost:11434/api/chat -d '{
"model": "qwen3:8b",
"stream": false,
"messages": [{"role": "user", "content": "Weather in Andorra?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Current weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}
}]
}'
```
## Embeddings
```bash
curl http://localhost:11434/api/embed -d '{
"model": "nomic-embed-text",
"input": ["first chunk", "second chunk"]
}'
```
Returns `embeddings` (array of float arrays). For the retrieval pipeline around these vectors, that's
`rag` / `embeddings-search`, not this skill.
## OpenAI-compatible layer (`/v1`)
| OpenAI path | Ollama support |
| --- | --- |
| `POST /v1/chat/completions` | yes — drop-in for chat |
| `POST /v1/completions` | yes — legacy text completion |
| `POST /v1/embeddings` | yes |
| `GET /v1/models` | lists pulled models |
Point any OpenAI SDK at the base URL with any non-empty key (it is ignored):
```python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
# streaming
for chunk in client.chat.completions.create(
model="qwen3:8b",
messages=[{"role": "user", "content": "hi"}],
stream=True):
print(chunk.choices[0].delta.content or "", end="")
```
Native-only knobs (`keep_alive`, `format` as a JSON Schema, `think`) aren't expressible through the
OpenAI layer — use `/api/chat` when you need them.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |