diff --git a/ollama/_client.py b/ollama/_client.py index 87fa881..7ea345b 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -571,7 +571,7 @@ def list(self) -> ListResponse: def delete(self, model: str) -> StatusResponse: r = self._request_raw( - 'DELETE', + 'POST', '/api/delete', json=DeleteRequest( model=model, @@ -1080,7 +1080,7 @@ async def list(self) -> ListResponse: async def delete(self, model: str) -> StatusResponse: r = await self._request_raw( - 'DELETE', + 'POST', '/api/delete', json=DeleteRequest( model=model, diff --git a/tests/test_client.py b/tests/test_client.py index aab2f2e..c2bd036 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -700,7 +700,7 @@ def test_client_create_blob_exists(httpserver: HTTPServer): def test_client_delete(httpserver: HTTPServer): - httpserver.expect_ordered_request(PrefixPattern('/api/delete'), method='DELETE').respond_with_response(Response(status=200)) + httpserver.expect_ordered_request(PrefixPattern('/api/delete'), method='POST').respond_with_response(Response(status=200)) client = Client(httpserver.url_for('/api/delete')) response = client.delete('dummy') assert response['status'] == 'success' @@ -1179,7 +1179,7 @@ async def test_async_client_create_blob_exists(httpserver: HTTPServer): @pytest.mark.asyncio async def test_async_client_delete(httpserver: HTTPServer): - httpserver.expect_ordered_request(PrefixPattern('/api/delete'), method='DELETE').respond_with_response(Response(status=200)) + httpserver.expect_ordered_request(PrefixPattern('/api/delete'), method='POST').respond_with_response(Response(status=200)) client = AsyncClient(httpserver.url_for('/api/delete')) response = await client.delete('dummy') assert response['status'] == 'success'