ollama/server
Michael Yang 58245413f4
next ollama runner (#7913)
feat: add new Ollama engine using ggml through cgo

This change introduces a new way to run pretrained models. It introduces 3 high level interfaces and a bunch of smaller helper interfaces to facilitate this.

- `model.Model` defines the interface for a model architecture. Models such as `llama` and `mllama`, which are provided as examples, can implement the model's forward propagation in the `Forward` method. This method will be called to generate completions. This interface can be found in `model/model.go`
- `ml.Backend` defines the interface for a backend tensor library, in this case `ggml`. Among other things, a Backend is responsible for loading a pretrained model into hardware (GPU, CPU, etc) and providing an interface for Models to access loaded tensors. This interface can be found in `ml/backend.go`
- `ml.Tensor` defines the interface for a tensor and tensor operations

This is the first implementation of the new engine. Follow up PRs will implement more features:

- non-greedy sampling (#8410)
- integration with Ollama and KV caching (#8301)
- more model support (#9080) with more coming soon

Co-authored-by: Bruce MacDonald <brucewmacdonald@gmail.com>
2025-02-13 16:31:21 -08:00
..
testdata/tools all: fix typos in documentation, code, and comments (#7021) 2024-12-10 12:58:06 -08:00
auth.go fix nil deref in auth.go 2024-07-26 14:14:48 -07:00
create.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
download.go server: increase timeout in stall detection from 5s to 30s (#8831) 2025-02-05 10:00:26 -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
images.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
layer.go One corrupt manifest should not wedge model operations (#7515) 2024-11-05 14:21:45 -08:00
manifest_test.go One corrupt manifest should not wedge model operations (#7515) 2024-11-05 14:21:45 -08:00
manifest.go One corrupt manifest should not wedge model operations (#7515) 2024-11-05 14:21:45 -08:00
model_test.go Update the /api/create endpoint to use JSON (#7935) 2024-12-31 18:02:30 -08:00
model.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
modelpath_test.go server: more support for mixed-case model names (#8017) 2024-12-11 15:29:59 -08:00
modelpath.go server: more support for mixed-case model names (#8017) 2024-12-11 15:29:59 -08:00
prompt_test.go prompt: Don't trim whitespace from prompts 2024-12-09 11:02:55 -08:00
prompt.go imageproc mllama refactor (#7537) 2024-12-14 19:50:15 -08:00
routes_create_test.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
routes_delete_test.go Update the /api/create endpoint to use JSON (#7935) 2024-12-31 18:02:30 -08:00
routes_generate_test.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
routes_list_test.go Update the /api/create endpoint to use JSON (#7935) 2024-12-31 18:02:30 -08:00
routes_test.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
routes.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
sched_test.go next ollama runner (#7913) 2025-02-13 16:31:21 -08:00
sched.go next ollama runner (#7913) 2025-02-13 16:31:21 -08: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
upload.go server: always print upload/download part info (#8832) 2025-02-04 19:30:49 -08:00