ollama

package
v0.314.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateModelfile added in v0.302.0

func CreateModelfile(
	filePath string,
	modelName string,
	spec *ModelSpec,
	contextLengthsByModelID map[string]int,
) error

CreateModelfile creates a new model file.

func ModelfilePath added in v0.302.0

func ModelfilePath(modelDir string, modelName string) string

ModelfilePath returns the model file path.

func SetEnvVarsFromConfig added in v0.233.0

func SetEnvVarsFromConfig(c config.OllamaConfig) error

SetEnvVarsFromConfig sets environment variables from the given configuration.

Types

type Manager

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

Manager manages the Ollama service.

TODO(kenji): Refactor this class once we completely switch to the one-odel-per-pod implementation where inference-manager-engine doesn't directly run vLLM or Ollama.

func New added in v0.190.0

func New(contextLengthsByModelID map[string]int, s3Client s3Client) *Manager

New returns a new Manager.

func (*Manager) CreateNewModelOfGGUF added in v0.273.0

func (m *Manager) CreateNewModelOfGGUF(modelName string, spec *ModelSpec) error

CreateNewModelOfGGUF creates a new model with the given name and spec that uses a GGUF model file.

func (*Manager) DownloadAndCreateNewModel added in v0.273.0

func (m *Manager) DownloadAndCreateNewModel(ctx context.Context, modelName string, resp *mv1.GetBaseModelPathResponse) error

DownloadAndCreateNewModel downloads the model from the given path and creates a new model.

func (*Manager) IsReady added in v0.212.0

func (m *Manager) IsReady() (bool, string)

IsReady returns true if the processor is ready. If not, it returns a message describing why it is not ready.

func (*Manager) PullBaseModel added in v0.7.0

func (m *Manager) PullBaseModel(modelName string) error

PullBaseModel pulls the base model from the given path.

func (*Manager) Run

func (m *Manager) Run() error

Run starts the Ollama service.

func (*Manager) UpdateModelTemplateToLatest added in v0.222.0

func (m *Manager) UpdateModelTemplateToLatest(modelName string) error

UpdateModelTemplateToLatest updates the model template to the latest.

func (*Manager) WaitForReady added in v0.7.0

func (m *Manager) WaitForReady() error

WaitForReady waits for the Ollama service to be ready.

type ModelSpec

type ModelSpec struct {
	From        string
	AdapterPath string
}

ModelSpec is the specification for a new model.

Jump to

Keyboard shortcuts

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