[GH-ISSUE #7985] Change /delete endpoint to use POST request #5108

Open
opened 2026-04-12 16:12:26 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @anxkhn on GitHub (Dec 7, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7985

What is the issue?

Description:

The Ollama API's /delete endpoint currently uses a DELETE request with a message body to specify the model to be deleted. This directly conflicts with the HTTP specification, which states that the DELETE method should NOT have a request body. 1 2

This non-standard approach causes significant issues with HTTP libraries like httpx, which correctly adhere to the specification and do not support sending data in a DELETE request.

Proposed Solution:

  • Change the /delete endpoint to accept a POST request instead. This aligns with how POST is used for actions that modify the server's state (in this case, deleting a model).
  • The request body can remain the same (e.g., {"model": "llama3:13b"}) to specify the model to delete.
  • Update the API documentation to clearly reflect this change.

Benefits:

  • Resolves the conflict with the HTTP specification.
  • Ensures compatibility with a wider range of standard HTTP libraries.
  • Improves the developer experience by avoiding unexpected errors and workarounds.

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.5.1

Originally created by @anxkhn on GitHub (Dec 7, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7985 ### What is the issue? **Description:** The Ollama API's `/delete` endpoint currently uses a DELETE request with a message body to specify the model to be deleted. This directly conflicts with the HTTP specification, which states that the DELETE method should NOT have a request body. [1](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) [2](https://apidog.com/articles/http-delete-request-body/) This non-standard approach causes significant issues with HTTP libraries like `httpx`, which correctly adhere to the specification and do not support sending data in a DELETE request. **Proposed Solution:** * **Change the `/delete` endpoint to accept a POST request instead.** This aligns with how POST is used for actions that modify the server's state (in this case, deleting a model). * The request body can remain the same (e.g., `{"model": "llama3:13b"}`) to specify the model to delete. * Update the API documentation to clearly reflect this change. **Benefits:** * **Resolves the conflict with the HTTP specification.** * **Ensures compatibility with a wider range of standard HTTP libraries.** * Improves the developer experience by avoiding unexpected errors and workarounds. ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.5.1
GiteaMirror added the bug label 2026-04-12 16:12:26 -05:00
Author
Owner

@nguu0123 commented on GitHub (Dec 9, 2024):

seems to be a good first issue, I will try to work on this

<!-- gh-comment-id:2529607829 --> @nguu0123 commented on GitHub (Dec 9, 2024): seems to be a good first issue, I will try to work on this
Author
Owner

@nguu0123 commented on GitHub (Dec 9, 2024):

maybe we also need to update ollama-python and ollama-js, will look into it if my PR is approved

<!-- gh-comment-id:2529684094 --> @nguu0123 commented on GitHub (Dec 9, 2024): maybe we also need to update ollama-python and ollama-js, will look into it if my PR is approved
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5108