ollama

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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