diff --git a/ollama/_client.py b/ollama/_client.py index faa6666..7ea345b 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -1080,7 +1080,7 @@ class AsyncClient(BaseClient): 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 d1bbd59..c2bd036 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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'