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)
---
name: ollama-knowledge-patch
description: Ollama
version: "0.40.19"
license: MIT
metadata:
author: Nevaberry
---
# Ollama knowledge patch
Load this skill for Ollama compatibility clients, native requests, model creation,
CLI integrations, cloud search, decision models, or acceleration and scheduling.
Use the quick reference here, then open the relevant topic for complete examples,
model-specific conditions, and attribution.
## Reference index
| Reference | Topics |
| --- | --- |
| [Compatibility APIs](references/compatibility-apis.md) | Messages, chat completions, Responses, embeddings, metadata, experimental image responses, decision requests and modalities |
| [Model creation](references/model-creation.md) | Modelfiles, GGUF, Safetensors, adapters, quantization, blobs, publishing, upgrades and rollback |
| [CLI and integrations](references/cli-and-integrations.md) | Installation, onboarding, model pickers, coding clients, desktop profiles and gateway |
| [Cloud models and web tools](references/cloud-and-web-tools.md) | Hosted inference, authentication, web search, fetch, tool loops, MCP, local-only configuration |
| [Native API and server](references/native-api-and-server.md) | Thinking, tools, lifecycle, inspection, timing, context, embeddings, proxies and origins |
| [Acceleration, images, and scheduling](references/acceleration-images-and-scheduling.md) | GPU and MLX support, drafting, memory, parallelism, experimental images, speech, model capabilities and platform restrictions |
The references retain source pointers from the changelog. Documents under
`sources/` are cited pointers and are not bundled with this skill.
## Breaking changes, deprecations, and migration
### Release and platform restrictions
- 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.
- Version 0.40.18 drops JetPack 5 support from the llama.cpp backend.
### Model creation and rollback
Remove `typical_p` when creating new models in 0.34.1 or later. Existing GGUF
models retain support; starting in 0.35.0, requests that send it log a warning
and continue. Safetensors creation with `ollama create` on MLX becomes stable
in 0.34.1. For GGUF builds, use `llama.cpp` tooling for Safetensors conversion
and quantization before importing the GGUF.
In 0.40.2, the first run of a previously downloaded model upgrades it in the
background for the llama.cpp backend, retaining its original copy for rollback.
Version 0.40.3 pauses background upgrades. To reclaim disk space, remove `ggml`
backup manifests by digest only for models that also have a `llamacpp` manifest.
After backup removal, re-pull the affected models if downgrading below 0.40.
The [model creation reference](references/model-creation.md#background-model-upgrades-and-rollback)
retains the cleanup procedure.
### Compatibility request limits
- Chat completions support tools, but clients must omit `tool_choice`,
`logit_bias`, `user`, `n`, and requests for log probabilities.
- Legacy completions accept a string `prompt` and support `suffix`; omit
`best_of`, `echo`, `logit_bias`, `user`, `n`, and requests for log probabilities.
- Responses is stateless: send history in `input` and omit `previous_response_id`
and `conversation`. Starting in 0.40.16, it honors `truncation` and no longer silently
truncates by default.
- Embeddings accept one string or a list of strings in `input`; clients sending
token IDs need to supply the original text. Use `dimensions` for length and
`encoding_format` for representation. Omit `user`.
## Compatibility APIs
### Messages, thinking, and vision
Starting in 0.14.0, `/v1/messages` supports tool calls, extended thinking, and image
input. Set the SDK base URL to `http://localhost:11434` and supply a placeholder
API key such as `ollama`, which the local server ignores.
On `/v1/chat/completions`, thinking models accept `reasoning_effort` and
`reasoning.effort`, each with `"high"`, `"medium"`, `"low"`, `"max"`, or `"none"`.
Starting in 0.40.17, a request to disable thinking selects the model's lowest
supported reasoning level.
For chat image input, put a base64 data URL in the `image_url` content part;
fetch and encode remote images on the client. Starting in 0.40.14, compatibility
endpoints use packaged sampling values when `temperature` and `top_p` are omitted,
matching `/api/chat`.
### Responses tools, history, and streaming
Send function definitions in `tools` on `/v1/responses`. The endpoint accepts
`instructions` and `max_output_tokens`, supports reasoning summaries for thinking
models, and supports web search starting in 0.32.11. Version 0.34.0 adds tool
search and response compaction to the compatibility API.
Responses history accepts custom tool calls from 0.40.5. From 0.40.7 it also
supports continuing after switching between models with and without thinking
and accepts compaction items from another provider. From 0.40.14 it preserves
readable content in supplied `input` history, including prior assistant refusals.
In streamed chat completions, `role` appears only in the first chunk,
`finish_reason` arrives in its own chunk, and usage arrives separately when
`stream_options.include_usage` is `true`. Truncation reports `"length"`.
Starting in 0.40.9, streamed `/v1/responses` and `/v1/messages` requests report
generation failures even after producing partial output.
Use `ollama cp` to register an installed local model under an identifier a client
always sends. Set `PARAMETER num_ctx` in a Modelfile to choose its context window.
## Create and inspect models
`FROM` can point to a local GGUF directory. Imported GGUF models retain tool
calling when supported; check for `tools` in `ollama show` before using an
integration that needs tool calls. Relative GGUF file paths in `FROM` and adapter
paths in `ADAPTER` resolve from the directory containing the Modelfile.
Prefer Safetensors adapters trained without QLoRA because fine-tuning frameworks
use different quantization methods. Set `FROM` to the exact base model used for
fine-tuning and `ADAPTER` to the adapter weights directory.
`REQUIRES` declares a valid minimum runtime release. Starting in 0.35.1,
`CAPABILITY` declarations survive GGUF or Safetensors creation, model inheritance,
and Modelfile export. The documented `repeat_penalty` default is `1.0`, disabling
the penalty; set a higher value to penalize repeated tokens.
For API creation, upload raw file bytes with `POST /api/blobs/<digest>` and send
filename-to-digest mappings in `files` to `POST /api/create`. Include Safetensors
config and tokenizer files; LoRA files use the same map format in `adapters`.
`HEAD /api/blobs/<digest>` returns `200` for a stored blob or `404` for a missing one.
Starting in 0.34.3, `ollama show` reports thinking levels and defaults;
`/api/show` returns `thinking.values` and `thinking.default`. Starting in 0.40.7,
inspection also reports renderer, parser, and chat template provenance.
Use `verbose: true` on `POST /api/show` for full tokenizer arrays in `model_info`.
## Native requests and server operation
For supported models, `POST /api/generate` and `POST /api/chat` accept top-level
`think` as a boolean or `"low"`, `"medium"`, `"high"`, or `"max"`. Chat puts reasoning
in `message.thinking`. Collect `message.tool_calls` as chunks arrive: a tool call
can arrive with `done: false` and `function.arguments` already a JSON object.
Send `messages: []` to chat to preload a model; add `keep_alive: 0` to unload it.
The response uses `done: true` and `done_reason` of `"load"` or `"unload"`.
With `raw: true`, generation expects the complete templated prompt and omits the
deprecated `context` array; keep conversation state on the client in this mode.
`prompt_eval_duration` measures only uncached prompt evaluation in the final
streamed generation response. Subtract `prompt_eval_cached_count` from
`prompt_eval_count` to get its token count. The FAQ lists a 4,096-token default
context window and `OLLAMA_CONTEXT_LENGTH` as the server-wide override.
## Launch integrations
Use `ollama launch <integration>` to select an integration directly. Add `--config`
to apply settings and start the tool later. The launcher prompts before continuing
with a deprecated agent model; **Pick another model** opens the picker even with
`--model` from 0.32.1. Set at least 64,000 context tokens for coding integrations.
`ollama launch claude` uses the selected model's full context from 0.40.2, applies
its output token limit from 0.40.14, and consistently routes to it from 0.40.16.
From 0.40.17, the client can defer MCP tool loading until needed.
`ollama launch codex` includes installed local models from 0.40.4 and checks
desktop routing before setup from 0.40.14, reporting an error if unavailable.
`ollama launch opencode` supports client version 2 from 0.40.12 and configures
thinking options from the selected model's metadata from 0.40.17.
`ollama launch chatgpt --restore` returns to the usual desktop profile. From
0.40.17, it asks before switching an active profile and preserves settings and
chat history. Bare `ollama` opens the welcome launcher in interactive terminals
from 0.40.15 and prints help in non-interactive shells from 0.40.17.
Ctrl+C or Ctrl+G leaves a multiline `"""` input block from 0.40.17.
## Cloud inference and web tools
Sign in with `ollama signin` and pull the full published cloud tag before calling
the local chat API with that tag. Inference runs on the hosted service. Some tags
use `<model>:<size>-cloud`; `ollama signout` keeps the user signed out. Published
decision model `:cloud` tags can run remotely without a local pull from 0.40.5.
The terminal integration supports subagents with any hosted model; explicitly
request delegation. Cloud sign-in enables Messages-layer web search for the main
agent and its subagents. Models using web search can perform up to ten searches
per response from 0.35.1.
Hosted search and fetch use an account API key in `OLLAMA_API_KEY` and bearer
authentication. Search returns `results` with `title`, `url`, and `content`;
fetch returns `title`, `content`, and `links`. Python helpers can be passed as
`tools=[web_search, web_fetch]`; append the assistant message, dispatch tool calls,
and send string tool results with `role="tool"` and the called `tool_name`.
Allow roughly 32,000 context tokens when possible for search and fetch results.
To disable cloud models and web search, set `disable_ollama_cloud` in
`~/.ollama/server.json` or `OLLAMA_NO_CLOUD=1`, restart the server, and check for
`cloud disabled: true` in its logs.
## Decision requests
Send a text `state` and named `questions` to `POST /v1/systemone` with a supported
decision model. The same 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 top-level
base64 `images` that every question evaluates jointly with `state` from 0.35.1.
From 0.35.1, `ollama show` and the model list report `decision` as the sole
capability of decision models. The CLI supports `--ask` from 0.40.4, with state
supplied positionally or through stdin. Request examples, hosted tags, and
model-specific modalities are in the [compatibility reference](references/compatibility-apis.md#decision-requests-and-capability-discovery).
## Acceleration, memory, and model selection
In 0.40.0, supported architectures use MLX automatically on ARM-based Macs;
regular tags work for supported chat models. For models implemented in the new
engine, the new scheduler measures exact memory requirements before loading to
determine GPU placement, and `ollama ps` memory usage matches `nvidia-smi` readings.
`OLLAMA_NUM_PARALLEL` defaults to `1` per model; allocated context scales with
parallelism times configured context length. Flash Attention is automatic when
supported; `OLLAMA_FLASH_ATTENTION=1` or `=0` forces it on or off. With it enabled,
`OLLAMA_KV_CACHE_TYPE` accepts `f16` (default), `q8_0`, or `q4_0` for all models.
`draft_num_predict` caps speculative draft tokens per step: `0` disables drafting,
separate draft models default to `4`, and embedded MTP tensors require an explicit
value. See the [acceleration reference](references/acceleration-images-and-scheduling.md)
for automatic MTP conditions, experimental image workflows, and model selection
by capabilities, sizes, context windows, modalities, and platform restrictions.