Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ollama Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-ollama-knowledge-patch-nevaberry-plugins)
---
name: ollama-knowledge-patch
description: Ollama
version: "0.40.19"
license: MIT
metadata:
author: Nevaberry
---
# Ollama compatibility and operations
Load this skill when configuring Ollama integrations, adapting API clients,
importing models, or diagnosing runtime and GPU behavior. Use the topic
references for complete request examples, model-specific conditions, and
operational details.
## Reference index
| Reference | Topics |
| --- | --- |
| [Cloud, integrations, and web](references/cloud-integrations-and-web.md) | Launcher setup, desktop profiles, coding clients, hosted models, search, fetch, MCP |
| [Compatibility APIs](references/compatibility-apis.md) | Messages, chat completions, Responses history, streaming, embeddings, model metadata |
| [Image generation and MLX](references/image-generation.md) | Experimental availability, CLI settings, image APIs, original MLX preview, NVFP4 |
| [Models and Modelfiles](references/models-and-modelfiles.md) | Imports, adapters, quantization, capabilities, thinking metadata, model selection |
| [Native REST API](references/native-api.md) | Blobs, model creation, generation, tools, tokenizer metadata, decision requests, speech |
| [Releases and runtime](references/releases-and-runtime.md) | Installation, rollback, CLI behavior, memory, concurrency, GPU backends, proxies |
## Breaking changes, deprecations, and release hazards
- Remove `typical_p` when creating new models in 0.34.1 or later. Existing
GGUF models retain support; requests sending it log a warning and continue
starting in 0.35.0.
- The llama.cpp backend drops JetPack 5 support in 0.40.18.
- Version 0.32.2 was withdrawn. Use 0.32.3 or later.
- Experimental image generation is temporarily unavailable in 0.32.6.
Use 0.32.5 for workflows that depend on it.
- In 0.34.1, Safetensors creation with `ollama create` on MLX becomes stable.
For GGUF builds, use `llama.cpp` tooling for Safetensors conversion and
quantization before importing the GGUF.
- Background upgrades introduced in 0.40.2 retain original models for
rollback; 0.40.3 pauses those upgrades. Remove `ggml` backup manifests by
digest only for models that also have a `llamacpp` manifest. After backup
removal, re-pull affected models if downgrading below 0.40. The runtime
reference contains the cleanup command.
## Compatibility request contracts
### Chat and legacy completions
`/v1/chat/completions` supports tools, but clients must omit `tool_choice`,
`logit_bias`, `user`, `n`, and requests for log probabilities. Thinking models
accept `reasoning_effort` or `reasoning.effort`, with `"high"`, `"medium"`,
`"low"`, `"max"`, or `"none"`.
Send images as base64 data URLs in `image_url` content parts. Fetch and
encode remote images on the client before sending them.
In streamed chat completions, `role` appears only in the first chunk,
`finish_reason` has its own chunk, and usage has a separate chunk when
`stream_options.include_usage` is `true`. Truncation reports `"length"`.
`/v1/completions` accepts a string `prompt` and a `suffix` after the generated
span. Omit `best_of`, `echo`, `logit_bias`, `user`, `n`, and requests for log
probabilities. Streamed usage requires `stream_options.include_usage: true`
with `stream: true`.
Starting in 0.40.14, compatibility endpoints use packaged model sampling
values when clients omit `temperature` and `top_p`, matching `/api/chat`.
### Responses history and tools
`/v1/responses` is stateless: send history in `input` and omit
`previous_response_id` and `conversation`. Starting in 0.40.16, it honors
`truncation`; the endpoint no longer silently truncates by default.
The endpoint accepts function definitions in `tools`, per-request
`instructions`, and `max_output_tokens`. It supports reasoning summaries
for thinking models and web search starting in 0.32.11.
Continued history supports custom tool calls from 0.40.5, switches between
models with and without thinking and another provider's compaction items
from 0.40.7, and readable prior assistant refusals from 0.40.14.
Starting in 0.40.9, streamed Responses and Messages requests report
generation failures even after partial output.
### Messages, embeddings, and discovery
Use `/v1/messages` for tool calls, extended thinking, and image input.
Set the SDK base URL to `http://localhost:11434` and provide a placeholder
API key such as `ollama`, which the local server ignores.
`/v1/embeddings` takes text: one string or a list of strings in `input`.
Clients sending token IDs need to supply the original text. Use `dimensions`
for embedding length and `encoding_format` for output representation; omit
`user`.
For `/v1/models` and `/v1/models/{model}`, `created` is the last modification
time and `owned_by` is the registry username, defaulting to `"library"`.
Starting in 0.40.16, `/v1/models` returns a model list of `[]` when none are
installed. Use `ollama cp` to register an installed model under a client's
hard-coded model identifier.
## Native generation, tools, and thinking
For supported models, `POST /api/generate` and `POST /api/chat` accept a
top-level `think` boolean or `"low"`, `"medium"`, `"high"`, or `"max"`.
Chat reasoning appears in `message.thinking`. Starting in 0.40.17,
requesting disabled thinking selects the model's lowest supported
reasoning level.
`ollama show` reports thinking levels and their default from 0.34.3;
`/api/show` exposes `thinking.values` and `thinking.default`.
Collect `message.tool_calls` while chat chunks arrive. Calls can have
`done: false` and already-decoded JSON objects in `function.arguments`;
the final chunk can report `done_reason: "stop"`. Starting in 0.40.17,
API tool definitions retain additional JSON Schema keywords.
With `raw: true`, supply the complete templated prompt to `/api/generate`
and keep conversation state on the client; the response omits the
deprecated `context` array. Final streamed `prompt_eval_duration` measures
only uncached tokens: subtract `prompt_eval_cached_count` from
`prompt_eval_count` for the corresponding count.
Send `messages: []` to `/api/chat` to preload; add `keep_alive: 0` to unload.
Responses use `done: true` with `done_reason: "load"` or `"unload"`.
## Model imports and declarations
`FROM` can name a directory containing GGUF files. Pass the Modelfile to
`ollama create`. Imported GGUF models retain tool calling when supported;
check for `tools` in `ollama show` before using a tool-dependent integration.
For adapters, use the exact base model used for fine-tuning. Prefer a
Safetensors adapter trained without QLoRA because fine-tuning frameworks
use different quantization methods. Relative GGUF `FROM` paths and
`ADAPTER` paths resolve from the Modelfile's directory.
`REQUIRES` declares a valid minimum release version. `CAPABILITY`
declarations survive GGUF or Safetensors creation, inheritance, and export
starting in 0.35.1. The documented `repeat_penalty` default is `1.0`,
which disables the penalty; higher values penalize repeated tokens.
`draft_num_predict` caps speculative draft tokens per step; `0` disables
drafting. Separate draft models default to `4`, while embedded MTP tensors
require an explicit value. The supported `:12b-mlx` build on ARM-based Macs
uses MTP by default from 0.31 and tunes draft length automatically; re-pull
a previously downloaded build as described in the runtime reference.
## Decision requests and speech
Send text `state` and named `questions` to `POST /v1/systemone` with a
supported decision model. Matching keys appear in `answers`: `choice`
returns a selection with probabilities and confidence, `noul` a condition
probability, and `score` a score across ordered criteria.
Image-capable decision models accept a top-level base64 `images` array
starting in 0.35.1; every question evaluates it jointly with `state`.
`ollama show` and model lists report `decision` as their sole capability.
Starting in 0.40.4, `ollama run <model> --ask` handles yes/no questions,
classification, and rubric scoring, with state supplied positionally or
through stdin. Published decision model `:cloud` tags run remotely without
a local pull starting in 0.40.5. See the references for platform and input
modality restrictions on individual decision model families.
Starting in 0.40.11, `ollama run` on macOS can play audio generated from
text or a chat reply; applications can stream speech via `/v1/audio/speech`.
## Cloud models, integrations, and web tools
For cloud models through the local chat API, sign in with `ollama signin`,
pull the full published cloud tag, and use that tag as `model`. Some tags
have the form `<model>:<size>-cloud`. Inference runs on the hosted service;
`ollama signout` keeps you signed out.
`ollama launch` guides model selection and applies integration settings.
Use `--config` to configure the tool for later use. The coding launch guide
recommends at least 64,000 context tokens; its local example needs about
23 GB of VRAM at that setting. `ollama launch claude` uses the selected
model's full context from 0.40.2 and its output token limit from 0.40.14.
The terminal integration supports subagents with any hosted model;
explicitly request delegation. Cloud sign-in enables built-in web search
for its main agent and subagents. Direct hosted search and fetch instead
use an account API key in `OLLAMA_API_KEY` with bearer authentication.
Python can pass `tools=[web_search, web_fetch]` directly to `chat()`, even
with a local tool-capable model. Append the assistant message, dispatch
tool calls, and send results with `role="tool"`, the called `tool_name`,
and string `content`. Allow roughly 32,000 context tokens when possible.
Models using web search can perform up to ten searches per response
starting in 0.35.1. See the web reference for SDK and MCP configuration.
## Runtime and terminal controls
On ARM-based Macs, architectures supported by MLX use it automatically
from 0.40.0; regular model tags work for supported chat models.
MLX text loading honors `OLLAMA_LOAD_TIMEOUT` from 0.32.1.
The FAQ lists a 4,096-token context default; `OLLAMA_CONTEXT_LENGTH`
overrides it server-wide. `OLLAMA_NUM_PARALLEL` defaults to `1` per model,
and allocated context scales with parallelism times configured context
length. Requests queue in order when their model cannot fit in memory.
Flash Attention is automatic when supported by the backend and devices;
`OLLAMA_FLASH_ATTENTION=1` or `=0` forces it on or off. With it enabled,
`OLLAMA_KV_CACHE_TYPE` accepts `f16` (default), `q8_0` (about half the cache
memory), or `q4_0` (about a quarter), applying to all models.
Set `disable_ollama_cloud` in `~/.ollama/server.json` or
`OLLAMA_NO_CLOUD=1`, restart, and check for `cloud disabled: true` to
disable cloud models and web search.
Bare `ollama` opens the welcome launcher in interactive terminals from
0.40.15 and prints help in non-interactive shells from 0.40.17. Press Enter
to accept a highlighted `@` file completion. In 0.40.17 and later, Ctrl+C
or Ctrl+G exits a multiline `"""` input block and resumes prompt entry.