Skip to content

byebyebruce/ollamax

Repository files navigation

Ollamax

Ollamax is a simple and easy to use library for making a local LLM app.
It is based on the Ollama

Demos

How to use

go >= 1.22

  1. Init your go module

    go mod init <module-name>
  2. Add submodule

    git submodule add https://github.com/byebyebruce/ollamax.git
  3. Init go work

    go work init . ./ollamax ./ollamax/ollama
  4. Build library

    make -C ollamax
  5. Write a test code

    import(
        "github.com/byebyebruce/ollamax"
    )
    
    if err := ollamax.Init(); err != nil {
        log.Fatalln(err)
    }
    defer ollamax.Cleanup()
    llm, err := ollamax.NewWithAutoDownload("qwen:0.5b")
    if err != nil {
        panic(err)
    }
    defer llm.Close()
    llm.Chat...

Where to find models

https://ollama.com/library