A Go library which provides a simple interface for interacting with any LLM.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-05-08 23:22:12 -06:00
.gitignore inital version 2025-05-08 22:57:34 -06:00
factory.go inital version 2025-05-08 22:57:34 -06:00
go.mod inital version 2025-05-08 22:57:34 -06:00
go.sum inital version 2025-05-08 22:57:34 -06:00
interface.go inital version 2025-05-08 22:57:34 -06:00
LICENSE Initial commit 2025-05-08 14:49:22 -06:00
openai.go move llm providers to gollm package 2025-05-08 23:22:12 -06:00
README.md add readme 2025-05-08 23:01:45 -06:00
types.go inital version 2025-05-08 22:57:34 -06:00

gollm

gollm is a Go library which provides a simple interface for interacting with any LLM in Go.

Usage

go get github.com/dickeyy/gollm
model, err := gollm.InitializeModel("gpt-4o-mini", "your-api-key")
if err != nil { panic(err) }

res, err := model.Chat(gollm.ChatStructure{
    Messages: []gollm.ChatMessage{
        {
            Role: "user",
            Content: "Hello, how are you?"
        },
    },
})
if err != nil { panic(err) }

fmt.Println(res.Text)

Supported Models

  • OpenAI:
    • GPT-4o-mini (gpt-4o-mini)
    • GPT-4o (gpt-4o)
    • GPT-3.5-turbo (gpt-3.5-turbo)

More models coming soon!

License

This project is licensed under the MIT License. See the LICENSE file for details.