cerebras.go

 1// Package cerebras provides a Fantasy provider for the Cerebras Inference API.
 2package cerebras
 3
 4import (
 5	"charm.land/fantasy"
 6	"charm.land/fantasy/providers/openaicompat"
 7)
 8
 9const (
10	// Name is the provider identifier for Cerebras.
11	Name = "cerebras"
12	// BaseURL is the default Cerebras API base URL.
13	BaseURL = "https://api.cerebras.ai/v1"
14)
15
16// Option configures the Cerebras provider via OpenAI-compatible options.
17type Option = openaicompat.Option
18
19// New creates a new Cerebras provider using OpenAI-compatible transport/options.
20func New(opts ...Option) (fantasy.Provider, error) {
21	options := []Option{
22		openaicompat.WithName(Name),
23		openaicompat.WithBaseURL(BaseURL),
24	}
25	options = append(options, opts...)
26	return openaicompat.New(options...)
27}