Skip to content

httpjamesm/together-ai-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

together-ai-go

Unofficial API library for together.ai

Quickstart

Create a new client

client := togetherai.NewClient(os.Getenv("TOGETHERAI_API_KEY"))

Infer with a model

resp, err := client.NewInference(InferenceConfig{
    Model:     "togethercomputer/RedPajama-INCITE-7B-Instruct",
    Prompt:    "The capital of France is",
    MaxTokens: 128,
    Stop:      &stopStrings,
})
if err != nil {
    panic(err)
}

fmt.Println(resp.Output.Choices)