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

Description

This module provides functions to fetch detailed information about a specific model on the Ollama server. It includes both high-level (showModel, showModelM) and low-level (showModelOps, showModelOpsM) APIs for retrieving model details, with support for verbose output. The operation is performed via a POST request to the "api/show" endpoint, returning a ShowModelResponse containing comprehensive model metadata.

The ShowModelOps type configures the request, and ShowModelResponse and ShowModelInfo represent the response structure. The module also re-exports ModelDetails for completeness.

Note: Verbose mode parsing is currently not fully supported.

Example:

>>> showModel "gemma3"
Right (ShowModelResponse {modelFile = "...", ...})

Since: 1.0.0.0

Synopsis

Show Model Info API

showModel Source #

Arguments

:: Text

Model name

-> IO (Either OllamaError ShowModelResponse) 

Simplified API for retrieving model information.

A higher-level function that fetches model information using default settings for verbose output and Ollama configuration. Suitable for basic use cases.

showModelM :: MonadIO m => Text -> m (Either OllamaError ShowModelResponse) Source #

MonadIO version of showModel for use in monadic contexts.

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

showModelOps Source #

Arguments

:: Text

Model name

-> Maybe Bool

Optional verbose flag

-> Maybe OllamaConfig

Optional OllamaConfig (defaults to defaultOllamaConfig if Nothing)

-> IO (Either OllamaError ShowModelResponse) 

Retrieves model information with configuration options.

Sends a POST request to the "api/show" endpoint to fetch detailed information about the specified model. Supports verbose output if verbose is 'Just True' (though verbose mode parsing is currently incomplete). Returns Right with a ShowModelResponse on success or Left with an OllamaError on failure.

showModelOpsM :: MonadIO m => Text -> Maybe Bool -> Maybe OllamaConfig -> m (Either OllamaError ShowModelResponse) Source #

MonadIO version of showModelOps for use in monadic contexts.

Lifts the showModelOps function into a MonadIO context, allowing it to be used in monadic computations with full configuration options.

Response Types

data ShowModelResponse Source #

Response structure for model information.

Constructors

ShowModelResponse 

Fields

data ShowModelInfo Source #

Detailed technical information about a model.

Constructors

ShowModelInfo 

Fields

Instances

Instances details
FromJSON ShowModelInfo Source #

JSON parsing instance for ShowModelInfo.

Instance details

Defined in Data.Ollama.Show

Show ShowModelInfo Source # 
Instance details

Defined in Data.Ollama.Show

Eq ShowModelInfo Source # 
Instance details

Defined in Data.Ollama.Show

data ModelDetails Source #

Metadata describing a specific model's identity and configuration.

Constructors

ModelDetails 

Fields