Installation¶
Requirements¶
- Go 1.21 or later
Install the SDK¶
go get github.com/agentplexus/go-opik
Install the CLI (Optional)¶
go install github.com/agentplexus/go-opik/cmd/opik@latest
Verify Installation¶
package main
import (
"fmt"
opik "github.com/agentplexus/go-opik"
)
func main() {
client, err := opik.NewClient()
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Println("Opik client created successfully!")
_ = client
}
Opik Server Options¶
Opik Cloud (Recommended)¶
Use the hosted Opik Cloud service:
- Sign up at comet.com
- Get your API key and workspace name
- Set environment variables:
export OPIK_API_KEY="your-api-key"
export OPIK_WORKSPACE="your-workspace"
Self-Hosted¶
Run Opik locally using Docker:
# Clone the Opik repository
git clone https://github.com/comet-ml/opik.git
cd opik
# Start with Docker Compose
docker-compose up -d
The local server runs at http://localhost:5173 by default.
export OPIK_URL_OVERRIDE="http://localhost:5173/api"
Next Steps¶
- Configuration - Configure the SDK for your environment
- Testing - Run the test suite (no API key required)
- Traces and Spans - Start tracing your LLM calls