diff --git a/ollama/_client.py b/ollama/_client.py index 3c5a767..6e40081 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -255,6 +255,7 @@ class Client(BaseClient): model: str, path: Optional[Union[str, PathLike]] = None, modelfile: Optional[str] = None, + quantize: Optional[str] = None, stream: bool = False, ) -> Union[Mapping[str, Any], Iterator[Mapping[str, Any]]]: """ @@ -276,6 +277,7 @@ class Client(BaseClient): 'name': model, 'modelfile': modelfile, 'stream': stream, + 'quantize': quantize, }, stream=stream, ) @@ -537,6 +539,7 @@ class AsyncClient(BaseClient): model: str, path: Optional[Union[str, PathLike]] = None, modelfile: Optional[str] = None, + quantize: Optional[str] = None, stream: bool = False, ) -> Union[Mapping[str, Any], AsyncIterator[Mapping[str, Any]]]: """ @@ -558,6 +561,7 @@ class AsyncClient(BaseClient): 'name': model, 'modelfile': modelfile, 'stream': stream, + 'quantize': quantize, }, stream=stream, ) diff --git a/tests/test_client.py b/tests/test_client.py index 158902f..711e3a7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -334,6 +334,7 @@ def test_client_create_path(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -357,6 +358,7 @@ def test_client_create_path_relative(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -389,6 +391,7 @@ def test_client_create_path_user_home(httpserver: HTTPServer, userhomedir): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -412,6 +415,7 @@ def test_client_create_modelfile(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -442,6 +446,7 @@ PARAMETER stop [/INST] PARAMETER stop <> PARAMETER stop <>''', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -478,6 +483,7 @@ def test_client_create_from_library(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM llama2', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -798,6 +804,7 @@ async def test_async_client_create_path(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -822,6 +829,7 @@ async def test_async_client_create_path_relative(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -846,6 +854,7 @@ async def test_async_client_create_path_user_home(httpserver: HTTPServer, userho 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -870,6 +879,7 @@ async def test_async_client_create_modelfile(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -901,6 +911,7 @@ PARAMETER stop [/INST] PARAMETER stop <> PARAMETER stop <>''', 'stream': False, + 'quantize': None, }, ).respond_with_json({}) @@ -938,6 +949,7 @@ async def test_async_client_create_from_library(httpserver: HTTPServer): 'name': 'dummy', 'modelfile': 'FROM llama2', 'stream': False, + 'quantize': None, }, ).respond_with_json({})