ollama/server
jmorganca d0f38a915a llama/compat: add gpt-oss and lfm2 handlers
gpt-oss: rename arch "gptoss" -> "gpt-oss" (incl. KV prefix), inject
the missing `expert_feed_forward_length` from the ffn_gate_exps shape,
and rename `attn_out`/`attn_sinks`/`ffn_norm` tensors to upstream's
`attn_output`/`attn_sinks.weight`/`post_attention_norm`. Also remove
the library/gpt-oss -> dhiltgen/gpt-oss redirect now that the compat
shim handles it directly.

lfm2: rename `output_norm.weight` -> `token_embd_norm.weight` and fix
a stale `lfm2.feed_forward_length` (some Ollama blobs claim 12288 on
a model whose ffn_gate is [2048, 8192]) by reading the real value off
the ffn_gate tensor shape.

Adds two helpers to compat-util: `copy_kv` (type-preserving generic
KV copy) and `rename_kv_prefix` (bulk-copy every KV with a given
prefix to a new prefix). Old keys are left in place — harmless because
the loader queries by exact name and only the new prefix matters.

Tested locally: gpt-oss:20b and lfm2.5-thinking now load + generate
coherently against an unmodified upstream llama-server build.
2026-04-20 09:29:34 -07:00
..
internal docs: fix typos in repository documentation (#10683) 2025-11-15 20:22:29 -08:00
auth_test.go server: reject unexpected auth hosts (#13738) 2026-01-16 14:10:36 -05:00
auth.go server: reject unexpected auth hosts (#13738) 2026-01-16 14:10:36 -05:00
cloud_proxy_test.go cloud_proxy: for the web_search legacy path, flush on newlines (#14897) 2026-03-17 13:30:17 -07:00
cloud_proxy.go cloud_proxy: for the web_search legacy path, flush on newlines (#14897) 2026-03-17 13:30:17 -07:00
create_test.go Clean up the manifest and modelpath (#13807) 2026-01-21 11:46:17 -08:00
create.go runner: Remove CGO engines, use llama-server exclusively for GGML models 2026-04-20 08:44:02 -07:00
download.go Clean up the manifest and modelpath (#13807) 2026-01-21 11:46:17 -08:00
fixblobs_test.go server: replace blob prefix separator from ':' to '-' (#3146) 2024-03-14 20:18:06 -07:00
fixblobs.go server: replace blob prefix separator from ':' to '-' (#3146) 2024-03-14 20:18:06 -07:00
gemma4_test.go gemma4: render differently based on model size 2026-04-15 14:37:16 -07:00
images_test.go create: avoid gc race with create (#15628) 2026-04-16 13:29:16 -07:00
images.go create: avoid gc race with create (#15628) 2026-04-16 13:29:16 -07:00
inference_request_log.go add ability to turn on debug request logging (#14106) 2026-03-19 17:08:17 -07:00
logprob.go logprob: add bytes to logprobs (#13068) 2025-11-13 13:49:25 -08:00
model_resolver_test.go Reapply "don't require pulling stubs for cloud models" again (#14608) 2026-03-06 14:27:47 -08:00
model_resolver.go llama/compat: add gpt-oss and lfm2 handlers 2026-04-20 09:29:34 -07:00
model.go create: Clean up experimental paths, fix create from existing safetensor model (#14679) 2026-04-07 08:12:57 -07:00
prompt_test.go gemma4: render differently based on model size 2026-04-15 14:37:16 -07:00
prompt.go gemma4: render differently based on model size 2026-04-15 14:37:16 -07:00
quantization.go runner: Remove CGO engines, use llama-server exclusively for GGML models 2026-04-20 08:44:02 -07:00
renderer_resolution.go gemma4: render differently based on model size 2026-04-15 14:37:16 -07:00
routes_cloud_test.go revert context length warnings change (#15121) 2026-03-28 16:43:59 -07:00
routes_create_test.go gemma4: render differently based on model size 2026-04-15 14:37:16 -07:00
routes_debug_test.go sched: Model eviction for MLX 2026-03-16 17:40:29 -07:00
routes_delete_test.go Reapply "don't require pulling stubs for cloud models" again (#14608) 2026-03-06 14:27:47 -08:00
routes_generate_renderer_test.go sched: Model eviction for MLX 2026-03-16 17:40:29 -07:00
routes_generate_test.go sched: Model eviction for MLX 2026-03-16 17:40:29 -07:00
routes_harmony_streaming_test.go sched: Model eviction for MLX 2026-03-16 17:40:29 -07:00
routes_list_test.go Update the /api/create endpoint to use JSON (#7935) 2024-12-31 18:02:30 -08:00
routes_options_test.go server: use tiered VRAM-based default context length 2026-02-02 10:47:09 -08:00
routes_request_log_test.go add ability to turn on debug request logging (#14106) 2026-03-19 17:08:17 -07:00
routes_test.go modelfiles: fix /save command and add shortname for safetensors based models (#15413) 2026-04-08 21:05:39 -07:00
routes_web_experimental_test.go cloud_proxy: send ollama client version (#14769) 2026-03-10 15:53:25 -07:00
routes.go runner: Remove CGO engines, use llama-server exclusively for GGML models 2026-04-20 08:44:02 -07:00
sched_test.go runner: Remove CGO engines, use llama-server exclusively for GGML models 2026-04-20 08:44:02 -07:00
sched.go runner: Remove CGO engines, use llama-server exclusively for GGML models 2026-04-20 08:44:02 -07:00
sparse_common.go Don't hard fail on sparse setup error 2024-08-09 12:16:19 -07:00
sparse_windows.go Don't hard fail on sparse setup error 2024-08-09 12:16:19 -07:00
test_home_test.go add ability to disable cloud (#14221) 2026-02-12 15:47:00 -08:00
upload.go Clean up the manifest and modelpath (#13807) 2026-01-21 11:46:17 -08:00