Commit Graph

64 Commits

Author SHA1 Message Date
b9f5e16c80 Introduce /api/embed endpoint supporting batch embedding (#5127)
* Initial Batch Embedding

* Revert "Initial Batch Embedding"

This reverts commit c22d54895a.

* Initial Draft

* mock up notes

* api/embed draft

* add server function

* check normalization

* clean up

* normalization

* playing around with truncate stuff

* Truncation

* Truncation

* move normalization to go

* Integration Test Template

* Truncation Integration Tests

* Clean up

* use float32

* move normalize

* move normalize test

* refactoring

* integration float32

* input handling and handler testing

* Refactoring of legacy and new

* clear comments

* merge conflicts

* touches

* embedding type 64

* merge conflicts

* fix hanging on single string

* refactoring

* test values

* set context length

* clean up

* testing clean up

* testing clean up

* remove function closure

* Revert "remove function closure"

This reverts commit 55d48c6ed1.

* remove function closure

* remove redundant error check

* clean up

* more clean up

* clean up
2024-07-15 12:14:24 -07:00
c69bc19e46 move OLLAMA_HOST to envconfig (#5009) 2024-06-12 18:48:16 -04:00
4bf1da4944 Separate ListResponse and ModelResponse for api/tags vs api/ps (#4842)
* Remove false time fields

* Struct Separation for List and Process

* Remove Marshaler
2024-06-06 10:11:45 -07:00
6845988807 Ollama ps command for showing currently loaded models (#4327) 2024-05-13 17:17:36 -07:00
d77c1c5f9d api: fill up API documentation (#3596)
* api: fill up API documentation

Followup for #2878

Now that the documentation is more complete, mention it in the README.

Updates #2840

* fix typo/lint

* Update README.md

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>

---------

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
2024-05-07 16:27:46 -07:00
9009bedf13 better checking for OLLAMA_HOST variable (#3661) 2024-04-29 19:14:07 -04:00
34b9db5afc Request and model concurrency
This change adds support for multiple concurrent requests, as well as
loading multiple models by spawning multiple runners. The default
settings are currently set at 1 concurrent request per model and only 1
loaded model at a time, but these can be adjusted by setting
OLLAMA_NUM_PARALLEL and OLLAMA_MAX_LOADED_MODELS.
2024-04-22 19:29:12 -07:00
ad90b9ab3d api: start adding documentation to package api (#2878)
* api: start adding documentation to package api

Updates #2840

* Fix lint typo report
2024-04-10 13:31:55 -04:00
e1c9a2a00f no blob create if already exists 2024-04-08 15:09:48 -07:00
1b272d5bcd change github.com/jmorganca/ollama to github.com/ollama/ollama (#3347) 2024-03-26 13:04:17 -07:00
897b213468 use http.DefaultClient (#2530)
default client already handles proxy
2024-02-20 18:34:47 -05:00
0d6e3565ae Add embeddings to API (#1773) 2024-01-04 15:00:52 -05:00
c3ff36088b Merge pull request #774 from jmorganca/mxyng/server-version
add version api and show server version in cli
2023-12-06 13:22:55 -08:00
195e3d9dbd chat api endpoint (#1392) 2023-12-05 14:57:33 -05:00
0db4706ec2 api: add version api handler 2023-12-05 09:36:01 -08:00
00d06619a1 Revert "chat api (#991)" while context variable is fixed
This reverts commit 7a0899d62d.
2023-12-04 21:16:27 -08:00
7a0899d62d chat api (#991)
- update chat docs
- add messages chat endpoint
- remove deprecated context and template generate parameters from docs
- context and template are still supported for the time being and will continue to work as expected
- add partial response to chat history
2023-12-04 18:01:06 -05:00
1901044b07 use checksum reference 2023-11-15 15:16:23 -08:00
1552cee59f client create modelfile 2023-11-15 15:16:23 -08:00
60bb3c03a1 use http.Method 2023-11-02 13:12:45 -07:00
5c3491f425 allow for a configurable ollama model storage directory (#897)
* allow for a configurable ollama models directory

- set OLLAMA_MODELS in the environment that ollama is running in to change where model files are stored
- update docs

Co-Authored-By: Jeffrey Morgan <jmorganca@gmail.com>
Co-Authored-By: Jay Nakrani <dhananjaynakrani@gmail.com>
Co-Authored-By: Akhil Acharya <akhilcacharya@gmail.com>
Co-Authored-By: Sasha Devol <sasha.devol@protonmail.com>
2023-10-27 10:19:59 -04:00
28c3f288e2 client: fix trailing slash 2023-10-26 11:09:38 -07:00
459f4a7889 fix: ollama host for hostname 2023-10-20 11:32:41 -07:00
92189a5855 fix memory check 2023-10-13 14:47:29 -07:00
b599946b74 add format bytes 2023-10-11 14:08:23 -07:00
274d5a5fdf optional parameter to not stream response (#639)
* update streaming request accept header
* add optional stream param to request bodies
2023-10-11 12:54:27 -04:00
2cfffea02e handle client proxy 2023-10-09 12:33:47 -07:00
9e2de1bd2c increase streaming buffer size (#692) 2023-10-04 14:09:00 -04:00
790d24eb7b add show command (#474) 2023-09-06 11:04:17 -07:00
246dc65417 loosen http status code checks 2023-08-28 18:34:53 -04:00
22ab7f5f88 default host to 127.0.0.1, fixes #424 2023-08-26 11:59:28 -07:00
2c7f956b38 add version 2023-08-22 09:40:58 -07:00
54bb49a502 parse protocol for OLLAMA_HOST 2023-08-17 18:20:44 -04:00
5ee6116420 set default OLLAMA_HOST to http://localhost:11434 2023-08-16 12:22:59 -04:00
67e593e355 cmd: support OLLAMA_CLIENT_HOST environment variable (#262)
* cmd: support OLLAMA_HOST environment variable

This commit adds support for the OLLAMA_HOST environment
variable. This variable can be used to specify the host to which
the client should connect. This is useful when the client is
running somewhere other than the host where the server is running.

The new api.FromEnv function is used to read configure clients from the
environment. Clients wishing to use the environment variable being
consistent with the Ollama CLI can use this new function.

* Update api/client.go

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>

* Update api/client.go

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>

---------

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
2023-08-16 11:03:48 -04:00
765994362c use head to check heartbeat 2023-08-01 14:50:38 -04:00
e72fe7945f check server is running before running command 2023-07-31 16:25:57 -04:00
4c1caa3733 download models when creating from modelfile 2023-07-25 14:25:13 -04:00
536028c35a better error message when model not found on pull 2023-07-24 17:48:17 -04:00
4cb42ca55e add copy command (#191) 2023-07-24 11:27:28 -04:00
6d6b0d3321 change error handler behavior and fix error when a model isn't found (#173) 2023-07-21 23:02:12 -07:00
7ba1308595 Merge pull request #147 from jmorganca/brucemacd/cli-err-display
Improve CLI error display
2023-07-21 16:10:19 +02:00
e7a393de54 add rm command for models (#151) 2023-07-20 16:09:23 -07:00
1f27d7f1b8 fix stream errors 2023-07-20 12:12:08 -07:00
ebaa33ac28 display gin api errors in cli 2023-07-20 20:45:12 +02:00
68df36ae50 fix pull 0 bytes on completed layer 2023-07-18 19:38:11 -07:00
5bea29f610 add new list command (#97) 2023-07-18 09:09:45 -07:00
2fb52261ad basic distribution w/ push/pull (#78)
* basic distribution w/ push/pull

* add the parser

* add create, pull, and push

* changes to the parser, FROM line, and fix commands

* mkdirp new manifest directories

* make `blobs` directory if it does not exist

* fix go warnings

* add progressbar for model pulls

* move model struct

---------

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
2023-07-16 17:02:22 -07:00
e243329e2e check api status 2023-07-11 13:42:05 -07:00
a3ec1ec2a0 consistent error handling for pull and generate 2023-07-10 21:34:15 -07:00