Commit Graph
40 Commits
Author SHA1 Message Date
Michael Yang a56f31a405 feat: implement full jsonschema spec
current ToolFunctionParameters and associated types supports only a
subset of the json schema spec. this means certain fields are dropped
from the schema. google/jsonschema-go supports the full draft-07/2020-12
keyword set and preserves unknown keywords but uses the native go map
which is unordered

vendor google/jsonschema-go and redefine map fields as
tailscale.com/types/mapx.OrderedMap. this uses mapx.OrderedMap instead
of internal/orderedmap because mapx.OrderedMap almost exactly matches
the signature we need while also _not_ implementing json.Marshaler and
json.Unmarshaler. this is important because wk8/go-ordered-map/v2 uses
encoding/json which by default escapes HTML characters such as `<`, `>`,
`&`

this change is the first of many changes that will migrate tools and
tool calls to using 1) jsonschema.Schema and 2) mapx.OrderedMap
2026-09-16 11:35:48 -07:00
Michael Yang d475d1f081 fix: qwen2.5vl metal argsort 2025-12-08 17:18:24 -08:00
Michael Yang 603ceefaa6 refactor rope
change to a flatter directory structure and group the options with the
function

update models to call rope in one place
2025-12-08 14:42:22 -08:00
Michael Yang eac5b8bfbd chore: mark vulkan shaders as vendored files 2025-11-19 12:01:23 -08:00
Michael Yang 0796d79d19 cuda: skip large batches
cuda panics on batches larger than 1024 so skip those and fallback to
cpu
2025-11-18 16:11:37 -08:00
Michael Yang 92981ae3f2 deepseekocr 2025-11-18 16:11:37 -08:00
Michael Yang 18087f2ec7 Revert "use llama runner for qwen3 (#12556)"
This reverts commit 3d32249c74.
2025-10-13 13:30:30 -07:00
Michael Yang 6c833d5f8d fix(qwen3): deepseek distill
deepseek's qwen3 distill uses a different rope scheme so support both
2025-10-13 13:30:30 -07:00
Michael Yang 1a2feb2a97 ollamarunner: fix deadlock
hardErrCh will deadlock since forwardBatch is blocked on
computeStartedCh which never gets sent. since the response to
hardErrCh is to panic, just panic instead
2025-10-10 16:49:57 -07:00
Michael Yang 629db9dc43 comment split 2025-10-10 13:25:34 -07:00
Michael Yang e0cd511661 fix test 2025-10-10 13:25:34 -07:00
Michael Yang 207332078f fix lint 2025-10-10 13:25:34 -07:00
Michael Yang 93085127f4 convert: slice gate_up weight 2025-10-10 13:25:34 -07:00
Michael Yang c00fa9cc2b convert: split gate_up bias 2025-10-10 13:25:34 -07:00
Michael Yang 967a82f52f ollamarunner: measure only active time 2025-10-09 15:44:04 -07:00
Michael Yang bbbc73d637 llamarunner: update metrics
this change updates how metrics are collected. until now, performance
metrics, specifically initial input processing and subsequent generation
durations, were collected by taking the timestamp when creating a new
sequence, the first token generation, and completing generation. the
processing duration is taken as first token generation sub sequence
creation while generation is taken as completing generation sub first
token generation.

while this approach is an accurate end-to-end metric of processing and
generation, it's not comparable to other tools which only measure the
active, i.e. decode, duration.

this change updates the metrics to only capture decode duration so it
can be more directly compared to other tools
2025-10-09 15:44:04 -07:00
Michael Yang 35ac4eb12c fix keep alive
this reference to keep alive was missed in #12041 so chat has a
diffferent behaviour than generate
2025-09-30 17:22:28 -07:00
Michael Yang 0469861d9d build: call find_package to instantiate library paths 2025-09-30 13:12:46 -07:00
Michael Yang f0ad49ea17 memory 2025-04-25 16:59:20 -07:00
Michael Yang 7ba9fa9c7d fixes for maverick 2025-04-25 16:59:20 -07:00
Michael Yang 8bf11b84c1 chunked attention 2025-04-25 16:59:20 -07:00
Michael Yang 470af8ab89 connect vision to text 2025-04-25 16:59:20 -07:00
Michael YangandPatrick Devine 178761aef3 image processing
Co-authored-by: Patrick Devine <patrick@infrahq.com>
2025-04-25 16:59:20 -07:00
Michael Yang f0c66e6dea llama4 2025-04-25 16:59:20 -07:00
Michael Yang 54055a6dae fix test 2025-04-25 16:59:01 -07:00
Michael Yang 340448d2d1 explicitly decode maxarraysize 1024 2025-04-25 16:59:01 -07:00
Michael Yang ced7d0e53d fix parameter count 2025-04-25 16:59:01 -07:00
Michael Yang a0dba0f8ae default slice values 2025-04-25 16:59:01 -07:00
Michael Yang 5e20b170a7 update comment 2025-04-25 16:59:01 -07:00
Michael Yang d26c18e25c fix token type 2025-04-25 16:59:01 -07:00
Michael Yang 8d376acc9b zero means zero
use a default of 1024 when asking for zero is confusing since most calls
seem to assume 0 means do not ready any data
2025-04-25 16:59:01 -07:00
Michael Yang dc1e81f027 convert: use -1 for read all 2025-04-25 16:59:01 -07:00
Michael Yang 5d0279164c generic ggml.array 2025-04-25 16:59:01 -07:00
Michael Yang 214a7678ea fix superfluous call to WriteHeader
the first call to http.ResponseWriter.Write implicitly calls WriteHeader
with http.StatusOK if it hasn't already been called. once WriteHeader
has been called, subsequent calls has no effect. Write is called when
JSON encoding progressUpdateJSON{}. calls to
http.ResponseWriter.WriteHeader after the first encode is useless and
produces a warning:

http: superfluous response.WriteHeader call from github.com/ollama/ollama/server/internal/registry.(*statusCodeRecorder).WriteHeader (server.go:77)
2025-04-25 16:58:49 -07:00
Michael Yang 4892872c18 convert: change to colmajor 2025-04-25 15:27:39 -07:00
Michael Yang 88738b357b create tempdir in models directory
the models directory should have plenty of storage and also ensure
there's no cross-device copy
2025-04-18 18:13:05 -07:00
Michael Yang 40b8fdbdca arange 2025-04-18 11:45:44 -07:00
Michael Yang 2fec73eef6 fix write gguf padding 2025-04-16 10:24:35 -07:00
Michael Yang d98bfe7e70 kvcache: stub out test structs 2025-04-08 15:08:29 -07:00
Michael Yang 16fca86c4a digest files in parallel 2025-04-07 09:46:31 -07:00