ollama/x/create
Patrick Devine 964ea42c09
mlx: x/create rewrite (#16919)
This is a rewrite of the create functionality for the MLX engine.

The core idea behind the create functionality is to break the import/convert into a pipeline of distinct phases:

* Read (scan the safetensors directory for the various bits of metadata)
* Classify (determine what the import type)
* Plan (determine any transforms that need to be done)
* Write (transform any data as necessary and write out the blobs)
* Create the manifest

Each architecture has a "policy" which determines how to convert the model correctly. A number of different formats for safetensors are supported including:

* nvfp4 (two formats: model optimized, torch)
* fp8 datatypes (convert to mxfp8)
* standard bf16 based weights

A number of cleanups/simplifications have been done including:

* using the baked in names for the tensors instead of munging them into something else
* unified 3d expert tensors (instead of separate per expert tensors)
* fewer unnecessary transforms to the various tensors in a model (keep a model as close to the source as possible)
* unified capability checking
* draft model handling (for MTP) is done on the same path

Image generation has been intentionally removed.
2026-07-03 18:30:45 -07:00
..
client mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
blockfp8.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
blockfp8_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
classify.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
classify_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
cohere2moe.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
create.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
create_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
draft.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
draft_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
dtype.go mlx: Support NVIDIA TensorRT Model Optimizer import (#15566) 2026-04-27 18:28:10 -07:00
gemma4.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
gemma4_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
inventory.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
inventory_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
laguna.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
mlxthread.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
pipeline.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
pipeline_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
plan.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
plan_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
prequant.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
prequant_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
quantize.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
quantpolicy.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
qwen35.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
transform.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
writer.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00
writer_test.go mlx: x/create rewrite (#16919) 2026-07-03 18:30:45 -07:00