ollama

package
v0.9.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a lightweight client for discovering Ollama models

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a new Ollama client

func (*Client) DiscoverEmbeddingModels

func (c *Client) DiscoverEmbeddingModels(ctx context.Context) ([]EmbeddingModel, error)

DiscoverEmbeddingModels finds available embedding models

func (*Client) IsAvailable

func (c *Client) IsAvailable(ctx context.Context) bool

IsAvailable checks if Ollama server is running

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context) ([]Model, error)

ListModels lists all available Ollama models

type Details

type Details struct {
	Format            string   `json:"format"`
	Family            string   `json:"family"`
	Families          []string `json:"families"`
	ParameterSize     string   `json:"parameter_size"`
	QuantizationLevel string   `json:"quantization_level"`
}

Details contains model metadata

type EmbeddingModel

type EmbeddingModel struct {
	Name       string
	Dimensions int
	Available  bool
}

EmbeddingModel represents a discovered embedding model

type Model

type Model struct {
	Name       string    `json:"name"`
	ModifiedAt time.Time `json:"modified_at"`
	Size       int64     `json:"size"`
	Digest     string    `json:"digest"`
	Details    Details   `json:"details"`
}

Model represents an Ollama model

type TagsResponse

type TagsResponse struct {
	Models []Model `json:"models"`
}

TagsResponse is the response from /api/tags endpoint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL