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.Copy

Description

This module provides functions to copy a model from a source name to a destination name using the Ollama API. It includes both an IO-based function (copyModel) and a monadic version (copyModelM) for use in MonadIO contexts. The copy operation is performed via a POST request to the "api/copy" endpoint.

Example:

>>> copyModel "gemma3" "gemma3-copy" Nothing
Right ()
Synopsis

Copy Model API

copyModel Source #

Arguments

:: Text

Source model name

-> Text

Destination model name

-> Maybe OllamaConfig

Optional OllamaConfig (defaults to defaultOllamaConfig if Nothing)

-> IO (Either OllamaError ()) 

Copies a model from a source name to a destination name.

Sends a POST request to the "api/copy" endpoint with the source and destination model names. Returns 'Right ()' on success or Left with an OllamaError on failure. Example:

>>> copyModel "gemma3" "gemma3-copy" Nothing
Right ()

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

MonadIO version of copyModel for use in monadic contexts.

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

Example:

>>> import Control.Monad.IO.Class
>>> runReaderT (copyModelM "gemma3" "gemma3-copy" Nothing) someContext
Right ()