Commit graph

585 commits

Author SHA1 Message Date
Jonathan Berg
0c7340b4bb respect CLAUDE_CODE_AUTO_COMPACT_WINDOW user setting 2026-10-08 10:33:11 -07:00
Jonathan Berg
c77b81c503 Set CLAUDE_CODE_MAX_CONTEXT_TOKENS to whatever the models context window is 2026-10-07 16:09:35 -07:00
Eva H
468e7e5008
cmd: remove account step from CLI onboarding (#18826) 2026-10-07 13:51:57 -04:00
Daniel Hiltgen
a00d083bb5
mlx: System one support (#18701)
* mlxrunner: restore System One scoring

Carry the MLX implementation and its tests from the original System One
commit. The API/compiler and llama-server implementation already exist on
the release branch, so retain those versions. Adapt the optional model test
to the renamed decision package and its explicit rendering/context setup.

(cherry picked from commit 26e546ddb3)

* Enable MLX System One and add regression coverage

* mlxrunner: add Laya support for System One

Import Laya checkpoints and implement bidirectional decision scoring.

* mlxrunner: release cached buffers after System One scoring

* decision: match Tev1 and Nimble publisher prompt formats

Select Tev1 prompts using renderer metadata and fix JSON formatting, with regression coverage for GGUF and MLX.

* mlx: support Clef and Clef Flash decision models

Add model import, quantization safeguards, and text/image scoring with the Clef joint decision head.

* support vision capabilities for decision models

* Make Clef scoring cancellable between prefill chunks

Preserve joint-head inputs and test cancellation, cleanup, and recovery.

* mlx: separate decision preparation and readout from forward

Let serial and batched scoring share model-owned preparation and readout
without duplicating architecture-specific logic in the runner.

* mlx: add Strands Decider support

* implement caching

---------

Co-authored-by: ParthSareen <parth.sareen@ollama.com>
2026-10-03 13:17:21 -07:00
Daniel Hiltgen
eadb68a609 Merge remote-tracking branch 'upstream/main' into release_v0.40.0
# Conflicts:
#	server/routes.go
2026-09-29 11:15:31 -07:00
Daniel Hiltgen
b3f78b7732
create: support explicit model capabilities (#18708)
Add CAPABILITY declarations to Modelfiles and an additive capabilities
field to create requests. Preserve declarations across GGUF and safetensors
creation, inheritance, and Modelfile export.

Require decision capability before scheduling System One requests instead
of matching Qwen architecture/renderer metadata. Retain main's GGUF-only
scoring restriction until the separate MLX runtime work lands.

Extracted from the capability foundation in 36d46a0c3 on system_one_mlx;
MLX scoring and manifest-list changes are intentionally separate.
2026-09-29 11:10:25 -07:00
Daniel Hiltgen
47bbe1eebe Merge remote-tracking branch 'upstream/main' into release_v0.40.0
# Conflicts:
#	server/images.go
#	server/routes.go
2026-09-28 14:14:00 -07:00
Daniel Hiltgen
16b4376aea
bench: use HumanEval patch prompts (#17480)
* bench: use code prompts for prompt-token runs

Replace the synthetic word-list prompt with packed HumanEval Python prompts so speculative draft models see code-like continuations.

Keep the benchmark on the chat path, and calibrate -prompt-tokens with untimed chat probes that read PromptEvalCount instead of relying on a separate token-count API.

Each request still gets a nonce prefix to avoid prefix-cache hits while timed epochs measure the chat-rendered workload.

* review comments

* use different windows for each epoch

* add OpenAI API support

* address comments
2026-09-26 07:29:54 -07:00
Daniel Hiltgen
75b952780f llama-server: prepare to remove compatibility patch
Add manifest-list storage so runner-specific manifests can coexist under one tag while preserving existing v1 tags as best-effort downgrade anchors. Show/list/copy/remove/pull/push now understand runner and digest selection and transfer referenced child manifests and layers.

Add lazy local compatibility migration for legacy Ollama GGUFs into llama.cpp-compatible children, covering the patched model families and preserving parser/renderer, templates, projectors, media metadata, split GGUFs, and MTP/draft tensors where applicable.

Extend create/import/conversion paths for the same compatibility rules, harden manifest-list combine validation, and add focused manifest, migration, transfer, and integration coverage for first-load conversion plus chat/tools/vision/audio/embedding behavior.
2026-09-24 19:25:52 -07:00
Daniel Hiltgen
7af393188d
api: deprecate typical_p (#18627)
Switch from rejecting API requests to logging a warning.  Model creation still rejects the deprecated param.

Follow up from #18448 to remove the hard API failure.
2026-09-24 15:03:28 -07:00
Parth Sareen
01c0fbfd35
launch: default Claude Code to client-side auto checks (#18596) 2026-09-23 15:20:45 -07:00
Eva H
ac3439083d
app: avoid System Events for ChatGPT/Codex detection (#18601) 2026-09-22 13:28:58 -07:00
Parth Sareen
d0c8cdb795
api: expose model thinking levels and defaults (#18473) 2026-09-18 14:10:53 -07:00
Eva H
7fa8a024b7
cli: add first-run onboarding shared with the desktop app (#18495) 2026-09-17 11:49:24 -07:00
Jesse Gross
04b450a81b mlxrunner, cmd, server: fold three small packages into their users
model/base held the Model interface and the architecture registry while
model held weight loading and quant parameters, and every architecture
imported both. create/client was the CLI side of safetensors imports,
with the create command as its only caller, a duplicate of the command's
adapter error, and a name that read like a second API client. The
safetensors show helpers had their own package under x/ although it
already declared package server.

base merges into model, so base.Model and base.Register become
model.Model and model.Register; nothing in the two overlapped. The create
client's two files and their tests join package cmd, and the five names
the command called are no longer exported. The show helpers join the
server package, and the three entry points routes.go calls become
unexported like the helpers around them.
2026-09-16 14:06:08 -07:00
Jesse Gross
2e036e7cdf mlx, mlxrunner: move the MLX engine out of x/
The MLX runner is the only Go inference runner left and is no longer
experimental, so its packages leave x/. The bindings become a top-level
mlx package beside the carried patches in mlx/compat, mirroring how
llama/ holds the llama.cpp integration, and the runner becomes mlxrunner
with the architectures nested under the package they implement.
Subpackages move with their parent unless listed.

  x/mlxrunner/mlx            mlx
  x/internal/mlxthread       mlx/mlxthread
  x/internal/mlxthreadtest   mlx/mlxthread/mlxthreadtest
  x/internal/mlxtest         mlx/mlxtest
  x/quant                    mlx/quant
  mlx/compat/*.patch         mlx/compat/mlx-c   (MLX patches go in mlx/compat/mlx)
  x/mlxrunner                mlxrunner
  x/models/nn                mlxrunner/nn
  x/models/<arch>            mlxrunner/model/<arch>
  x/mlxrunner/imports.go     mlxrunner/model/architectures   (new package)
  x/create                   create
  x/safetensors              fs/safetensors
  x/tokenizer                mlxrunner/tokenizer

Every package keeps its name, so the Go changes are the import path
rewrites the moves force, and the CMake, Dockerfile, CI cache keys, drift
check and Darwin payload script follow the new paths. Four edits are not
paths: the runner's blank architecture imports become the package
mlxrunner/model/architectures, so the list to extend for a new model sits
beside the architecture directories; a depguard rule keeps the two test
harnesses out of non-test code, as the x/internal placement used to; the
CI change filter's two entries for the long-deleted x/imagegen/mlx now
name the bindings' CMake project and the carried patches, so a change to
either builds the payload; and the tokenizer parity test reads its
fixtures from its own testdata instead of walking out of x/.

x/server and x/imagegen/manifest stay for the next two commits.
2026-09-16 14:06:08 -07:00
Jesse Gross
6a0ee48080 cmd: launch the MLX runner without the engine dispatcher
The runner package used to pick an engine from the first argument of the
runner subcommand. Only the MLX engine is left, so the dispatcher has a
single arm, its README still describes the removed Go runner's flags and
endpoints, and the standalone cmd/runner binary exists only to invoke it.

We call mlxrunner.Execute directly from the hidden runner subcommand and
drop the --mlx-engine argument from the command line the MLX client
spawns. Both sides ship in the same binary, so nothing has to accept both
forms. The runner package and cmd/runner are removed.

The subcommand's help hook hands the runner a bare --help. cobra calls the
hook with no arguments for `ollama help runner`, which used to index past
the end of the slice.
2026-09-16 14:06:08 -07:00
Daniel Hiltgen
2c29c9f05e
API: Deprecate typical_p (#18448)
Drop support for creating new models with typical_p parameters, while
retaining support for existing GGUF models with the setting.
2026-09-14 21:24:26 -07:00
Daniel Hiltgen
98acec40ae
create: add server-side MLX imports and drop GGUF conversion (#14969)
* create: add server-side MLX imports and drop GGUF conversion

Support safetensors imports through the MLX create pipeline both locally and on the server, including remote upload/staging, draft layer handling, cancellation propagation, transfer limits, and shared manifest/blob writing.

Limit GGUF create to wrapping existing GGUF inputs into Ollama manifests. Remove the in-tree safetensors-to-GGUF converter, server quantization path, and converter-only dependencies so GGUF conversion and quantization stay in llama.cpp tooling.

Keep the MLX path focused on supported safetensors model creation with validation before MLX work, and expose that flow without the --experimental CLI gate.

* address comments

* add client side gguf create fast path

* address comments

* rebase adjustments
2026-09-14 20:32:36 -07:00
Parth Sareen
c16bf9892a
cmd: remove built-in agent (#18393) 2026-09-11 12:21:52 -07:00
Eva H
34afa1a0c8
app: open Codex by default for Ollama launches (#18323) 2026-09-08 13:40:20 -07:00
Parth Sareen
9ef6c19341
app: preserve Codex configuration across host changes (#18247) 2026-09-08 12:42:37 -07:00
Parth Sareen
83ed7d9965
app: harden Codex desktop proxy handling (#18244) 2026-09-04 17:48:55 -07:00
Parth Sareen
43e667004a
app: route Codex auto review through selected model (#18246) 2026-09-04 17:48:37 -07:00
Eva H
87b9f9e95a
app: add Ollama to ChatGPT Desktop (#18236) 2026-09-04 14:04:48 -07:00
Daniel Hiltgen
855f4bf989
Report cached prompt tokens (#17943)
* Report cached prompt tokens

Add prompt_eval_cached_count to native responses and expose equivalent cached-token fields through the OpenAI- and Anthropic-compatible APIs. Keep prompt_eval_count as the logical input total while excluding cache hits from CLI and benchmark prefill rates. Surface processed and cached prompt counts in benchmark output.

Collect cache counts from llama-server and MLX, preserve coherent metrics across two-pass structured generation.

Fixes #8008

Related to #15758

* review comments
2026-09-02 09:30:44 -07:00
Marcel Petrick
e37a00a8fa
fix(docs): correct typos found during code review (#17579)
* fix(docs): correct typos found during code review

Non-functional changes only:
- Fixed minor spelling mistakes in comments
- Corrected typos in user-facing strings
- No variables, logic, or functional code was modified.

Signed-off-by: Marcel Petrick <mail@marcelpetrick.it>

* fix additional typos and shell-unsafe example in docs

---------

Co-authored-by: Patrick Devine <patrick@ollama.com>
2026-08-31 08:59:55 -07:00
Daniel Hiltgen
91cf995996
launch: respect OLLAMA_HOST when configuring Pi (#18039)
Pi's Edit() only set baseUrl when creating a new ollama provider entry.
On subsequent launches it preserved whatever baseUrl was already in
~/.pi/agent/models.json, so switching OLLAMA_HOST to a remote server had
no effect — Pi would still connect to localhost.

Edit() now ensures baseUrl reflects the current OLLAMA_HOST. Models()
returns nil when the stored baseUrl no longer matches, so the launcher
only calls Edit() when the host has actually drifted. User-customized api
and apiKey fields are still preserved.
2026-08-26 13:24:05 -07:00
Eva H
f6c59d8703
app: add Claude Desktop model mappings (#17979) 2026-08-24 22:43:47 -04:00
Parth Sareen
82ad9fa38b
app: add Claude Desktop Auto mode setting (#17975) 2026-08-24 18:20:59 -07:00
Anas Khan
02dc3ea4c3
cmd: guard empty editor before indexing fields (#17067)
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-08-24 09:50:40 -07:00
Devon Rifkin
add1f92bdd
launch: disable claude code token countdown to preserve KV cache (#17918)
Claude Code adds a "tokens left" system message after every tool
result. Since ollama moves system messages to the front of the prompt,
this breaks the KV cache on every request.
2026-08-21 17:44:44 -07:00
Parth Sareen
2d9622a4d4
app: claude model management (#17915) 2026-08-21 15:04:58 -07:00
Eva H
30019c87c4
app: add Connect your apps experience (#17900) 2026-08-21 12:56:51 -07:00
Parth Sareen
8f912415e8
launch: fall back to npx for DeepSeek Harness (#17758) 2026-08-20 14:04:44 -07:00
Parth Sareen
30546d1fd4
app: add claude desktop app (#17899) 2026-08-20 14:03:43 -07:00
Daniel Hiltgen
6bba484f1a
lint fixes (#17897) 2026-08-20 10:23:25 -07:00
Parth Sareen
39df91c982
launch: add DeepSeek Harness integration (#17733) 2026-08-13 15:19:02 -07:00
Daniel Hiltgen
01d04d50f8
launch: add Muse Code integration (#17594)
* launch: add Muse Code integration

Add `ollama launch muse` for Meta's Muse Code CLI.

Muse only takes a model catalog from settings.json (normally it fetches one from its provider and refuses to start otherwise), and that file's endpoint_transport is a global provider switch. So the integration writes a settings file under its own config root (~/.ollama/launch/muse-config via XDG_CONFIG_HOME), leaving a Meta-backed muse install untouched, and re-seeds it from muse's own persisted copy on later runs.

The launched model is preloaded so its catalog row carries the context length the server actually allocated, not the trained maximum; the loaded-context helpers move from cmd/agent_tui.go into cmd/launch for reuse.

Muse sends reasoning efforts outside Ollama's scale (minimal, xhigh, ultra), which were hard 400s; clamp them to the nearest tier in one helper shared by the chat and responses converters.

The registry entry stays Hidden (alias "muse-code"), like kimi and vscode.

* review comments

* skip muse test on windows (unsupported platform)
2026-08-13 13:10:29 -07:00
Parth Sareen
9a56a0e845
agent: allow multiple edits per edit tool call (#17711) 2026-08-12 16:45:53 -07:00
Parth Sareen
f91cb0d6a7
agent/tui: stream thinking traces (#17611) 2026-08-07 13:11:45 -07:00
Eva H
8dd34b77d1
cmd/tui: restore launcher integrations menu (#17595) 2026-08-07 11:11:16 -07:00
Devon Rifkin
8d8c701d6a
Merge pull request #17483 from ollama/drifkin/suggest-cloud
cmd: suggest :cloud when a model has no default tag
2026-07-31 14:28:04 -07:00
Daniel Hiltgen
9ea503f505
lint: clean up current tree (#17456) 2026-07-29 15:33:28 -07:00
Jeffrey Morgan
4713800b08
imagegen: remove MLX image generation code (#16615)
Remove the x/imagegen tree (MLX image generation engine, Flux2/zimage
models, cache, C bindings) and all imagegen integration points:

- server: drop imagegen routes, scheduling, and generate handling
- api/cmd/docs: remove image generation API surface and docs
- middleware/openai: remove image endpoint support
- integration: remove imagegen test suites
- x/create: adopt the rewritten create pipeline from main; drop
  imagegen create path (CreateImageGenModel, IsTensorModelDir,
  model_index.json detection, Flux2KleinPipeline vision hack)
- retain x/imagegen/manifest (Ollama-store safetensors manifest
  loader), still used by x/mlxrunner and x/create/client
- fix Windows MLX dl.dll install, MLX CMake version path, and the
  show command after removing safetensors models
2026-07-28 15:35:28 -07:00
Parth Sareen
0e2e34aa86
cmd/tui: improve prompt debug rendering (#17334) 2026-07-27 17:29:18 -07:00
Parth Sareen
76929b0a8a
agent: accept file mentions on Enter (#17384) 2026-07-27 17:28:55 -07:00
Parth Sareen
bf7be180e3
tui: avoid table detection for pipe prose (#17424) 2026-07-27 13:42:08 -07:00
Parth Sareen
3f07e022ac
cmd/tui: agent system prompt command (#17296) 2026-07-24 14:44:25 -07:00
Parth Sareen
551809688b
agent: permission skill loading (#17304) 2026-07-24 14:37:21 -07:00