Skip to content

cirello-io/ollamago

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ollamago

A Go SDK for Ollama, providing a simple interface to interact with Ollama's API.

Installation

go get cirello.io/ollamago

Usage

package main

import (
	"fmt"
	"cirello.io/ollamago"
)

func main() {
	c := ollamago.Client{}
	resp, err := c.GenerateChat(context.Background(), ollamago.ChatRequest{
		Model: "llama3.2",
		Messages: []ollamago.ChatMessage{{
			Role:    "user",
			Content: "say hello world",
		}},
		Stream: true,
	})
	if err != nil {
		panic(err)
	}
	for r := range resp {
		if r.Done {
			break
		}
		fmt.Print(r.Message.Content)
	}
}

Features

Mostly implements the contents of https://github.com/ollama/ollama/blob/main/docs/api.md:

  • Generate a completion
  • Generate a chat completion
  • Create a Model
  • List Local Models
  • Show Model Information
  • Copy a Model
  • Delete a Model
  • Pull a Model
  • Push a Model
  • Generate Embeddings
  • List Running Models
  • Version

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages