| Copyright | (c) 2025 Tushar Adhatrao |
|---|---|
| License | MIT |
| Maintainer | Tushar Adhatrao <tusharadhatrao@gmail.com> |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- showModel :: Text -> IO (Either OllamaError ShowModelResponse)
- showModelM :: MonadIO m => Text -> m (Either OllamaError ShowModelResponse)
- showModelOps :: Text -> Maybe Bool -> Maybe OllamaConfig -> IO (Either OllamaError ShowModelResponse)
- showModelOpsM :: MonadIO m => Text -> Maybe Bool -> Maybe OllamaConfig -> m (Either OllamaError ShowModelResponse)
- data ShowModelResponse = ShowModelResponse {
- modelFile :: !Text
- parameters :: !(Maybe Text)
- template :: !(Maybe Text)
- details :: !ModelDetails
- modelInfo :: !ShowModelInfo
- license :: !(Maybe Text)
- capabilities :: Maybe [Text]
- data ShowModelInfo = ShowModelInfo {
- generalArchitecture :: !(Maybe Text)
- generalFileType :: !(Maybe Int)
- generalParameterCount :: !(Maybe Int64)
- generalQuantizationVersion :: !(Maybe Int)
- llamaAttentionHeadCount :: !(Maybe Int)
- llamaAttentionHeadCountKV :: !(Maybe Int)
- llamaAttentionLayerNormRMSEpsilon :: !(Maybe Float)
- llamaBlockCount :: !(Maybe Int)
- llamaContextLength :: !(Maybe Int)
- llamaEmbeddingLength :: !(Maybe Int)
- llamaFeedForwardLength :: !(Maybe Int)
- llamaRopeDimensionCount :: !(Maybe Int)
- llamaRopeFreqBase :: !(Maybe Int64)
- llamaVocabSize :: !(Maybe Int64)
- tokenizerGgmlBosToken_id :: !(Maybe Int)
- tokenizerGgmlEosToken_id :: !(Maybe Int)
- tokenizerGgmlMerges :: !(Maybe [Text])
- tokenizerGgmlMode :: !(Maybe Text)
- tokenizerGgmlPre :: !(Maybe Text)
- tokenizerGgmlTokenType :: !(Maybe [Text])
- tokenizerGgmlTokens :: !(Maybe [Text])
- data ModelDetails = ModelDetails {
- parentModel :: !(Maybe Text)
- format :: !Text
- family :: !Text
- families :: ![Text]
- parameterSize :: !Text
- quantizationLevel :: Text
Show Model Info API
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 #
Arguments
| :: Text | Model name |
| -> Maybe Bool | Optional verbose flag |
| -> Maybe OllamaConfig | Optional |
| -> 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
| |
Instances
| FromJSON ShowModelResponse Source # | JSON parsing instance for |
Defined in Data.Ollama.Show Methods parseJSON :: Value -> Parser ShowModelResponse # parseJSONList :: Value -> Parser [ShowModelResponse] # | |
| Show ShowModelResponse Source # | |
Defined in Data.Ollama.Show Methods showsPrec :: Int -> ShowModelResponse -> ShowS # show :: ShowModelResponse -> String # showList :: [ShowModelResponse] -> ShowS # | |
| Eq ShowModelResponse Source # | |
Defined in Data.Ollama.Show Methods (==) :: ShowModelResponse -> ShowModelResponse -> Bool # (/=) :: ShowModelResponse -> ShowModelResponse -> Bool # | |
data ShowModelInfo Source #
Detailed technical information about a model.
Constructors
| ShowModelInfo | |
Fields
| |
Instances
| FromJSON ShowModelInfo Source # | JSON parsing instance for |
Defined in Data.Ollama.Show Methods parseJSON :: Value -> Parser ShowModelInfo # parseJSONList :: Value -> Parser [ShowModelInfo] # | |
| Show ShowModelInfo Source # | |
Defined in Data.Ollama.Show Methods showsPrec :: Int -> ShowModelInfo -> ShowS # show :: ShowModelInfo -> String # showList :: [ShowModelInfo] -> ShowS # | |
| Eq ShowModelInfo Source # | |
Defined in Data.Ollama.Show Methods (==) :: ShowModelInfo -> ShowModelInfo -> Bool # (/=) :: ShowModelInfo -> ShowModelInfo -> Bool # | |
data ModelDetails Source #
Metadata describing a specific model's identity and configuration.
Constructors
| ModelDetails | |
Fields
| |
Instances
| FromJSON ModelDetails Source # | |
Defined in Data.Ollama.Common.Types | |
| Show ModelDetails Source # | |
Defined in Data.Ollama.Common.Types Methods showsPrec :: Int -> ModelDetails -> ShowS # show :: ModelDetails -> String # showList :: [ModelDetails] -> ShowS # | |
| Eq ModelDetails Source # | |
Defined in Data.Ollama.Common.Types | |