ollama-haskell-0.2.0.0: Haskell client for ollama.
Copyright(c) 2025 Tushar Adhatrao
LicenseMIT
MaintainerTushar Adhatrao <[email protected]>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Ollama.Delete

Description

This module provides functions to delete a model from the Ollama server using its name. It includes both an IO-based function (deleteModel) and a monadic version (deleteModelM) for use in MonadIO contexts. The delete operation is performed via a DELETE request to the "api/delete" endpoint.

Example:

>>> deleteModel "gemma3" Nothing
Right ()
Synopsis

Delete Model API

deleteModel Source #

Arguments

:: Text

Model name to delete

-> Maybe OllamaConfig

Optional OllamaConfig (defaults to defaultOllamaConfig if Nothing)

-> IO (Either OllamaError ()) 

Deletes a model from the Ollama server.

Sends a DELETE request to the "api/delete" endpoint with the specified model name. Returns 'Right ()' on success or Left with an OllamaError on failure.

deleteModelM :: MonadIO m => Text -> Maybe OllamaConfig -> m (Either OllamaError ()) Source #

MonadIO version of deleteModel for use in monadic contexts.

Lifts the deleteModel function into a context, allowing it to be used in monadic computations.