providercatalog

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowsEmptyAPIKey

func AllowsEmptyAPIKey(typ string) bool

AllowsEmptyAPIKey reports whether empty api_key_env is valid for this type.

func CatalogAliases

func CatalogAliases(typ string) []string

CatalogAliases returns modelcatalog fallback types for a provider type.

func RegisterSpec

func RegisterSpec(spec Spec)

RegisterSpec stores or replaces a provider type Spec.

Types

type AuthMode

type AuthMode string

AuthMode controls whether an empty api_key_env is allowed at call time.

const (
	// AuthAPIKey requires api_key_env or a BYOK credential.
	AuthAPIKey AuthMode = "api_key"
	// AuthOptional allows empty api_key_env (e.g. AWS default credential chain).
	AuthOptional AuthMode = "optional"
)

type Capabilities

type Capabilities struct {
	Chat      bool `json:"chat"`
	Stream    bool `json:"stream"`
	TTS       bool `json:"tts"`
	STT       bool `json:"stt"`
	Embedding bool `json:"embedding"`
	Image     bool `json:"image"`
}

Capabilities describes default modality support for a provider type.

type SeedRoute

type SeedRoute struct {
	ID          string
	Model       string
	TargetModel string
}

SeedRoute is an optional demo route created with a seeded provider.

type Spec

type Spec struct {
	Type             string
	DisplayName      string
	DefaultBaseURL   string
	DefaultAPIKeyEnv string
	Capabilities     Capabilities
	AuthMode         AuthMode
	UIVisible        bool
	Seed             bool
	SeedID           string // defaults to prov_<type>
	SeedRoute        *SeedRoute
	CatalogAlias     string // modelcatalog fallback type
}

Spec is the single registration record for a provider type.

func All

func All() []Spec

All returns registered Specs sorted by type.

func Lookup

func Lookup(typ string) (Spec, bool)

Lookup returns the Spec for a provider type.

func Must

func Must(typ string) Spec

Must returns the Spec or a zero Spec with AuthAPIKey for unknown types.

func Seedable

func Seedable() []Spec

Seedable returns Specs that should appear in local-dev seed.

func UIVisible

func UIVisible() []Spec

UIVisible returns Specs marked for the create-provider UI.

func (Spec) SeedProviderID

func (s Spec) SeedProviderID() string

SeedProviderID returns the stable seed row id for a Spec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL