Documentation
¶
Index ¶
- Constants
- func IsCodingModel(model Model) bool
- func IsKnownNonCodingModelID(id string) bool
- func IsSTTModel(model Model) bool
- func IsSTTModelID(id string) bool
- func LooksLikeCodingModelID(id string) bool
- func ModelIDAllowedForProvider(providerID, modelID string) bool
- func ModelsDevProviderID(provider providercatalog.Descriptor) string
- type FetchOptions
- type Model
- func FetchModelsDev(ctx context.Context, providerID string, options FetchOptions) ([]Model, error)
- func FetchOpenGateway(ctx context.Context, endpoint string, options FetchOptions) ([]Model, error)
- func FetchRemote(ctx context.Context, provider providercatalog.Descriptor, options FetchOptions) ([]Model, error)
- func FilterModelsForProvider(providerID string, models []Model) []Model
- func Models(provider providercatalog.Descriptor) []Model
- func ParseModelsDevProvider(body []byte, providerID string) ([]Model, error)
- func ParseOpenGatewayCatalog(body []byte) ([]Model, error)
Constants ¶
const (
DefaultModelsDevURL = "https://models.dev/api.json"
)
Variables ¶
This section is empty.
Functions ¶
func IsCodingModel ¶
func IsKnownNonCodingModelID ¶
func IsSTTModel ¶ added in v0.3.0
IsSTTModel reports whether a model transcribes speech to text — the models IsKnownNonCodingModelID filters OUT of the coding picker, filtered back IN for the /stt-model picker.
The reliable signal is the model's declared modalities, not its name: a transcriber consumes audio and emits text. Anything that emits audio is text-to-speech or speech-to-speech, never a transcriber, so audio output is a hard disqualifier. Only when a catalog entry carries no usable modality metadata (common for the Groq/OpenAI transcription models, which models.dev lists sparsely) do we fall back to a name heuristic.
func IsSTTModelID ¶ added in v0.3.0
IsSTTModelID is the name-only heuristic used when a catalog entry declares no modalities. It matches the known transcription model families and explicitly rejects text-to-speech names, so it never confuses a TTS model for a transcriber. Weaker than the modality signal in IsSTTModel — a fallback, not the primary test.
func LooksLikeCodingModelID ¶
func ModelIDAllowedForProvider ¶ added in v0.3.0
ModelIDAllowedForProvider reports whether a model ID is permitted for the given provider under provider-specific allow/block rules. For opencode-go-anthropic-compatible: only Qwen and MiniMax model IDs are allowed. Allows ANY model by default
func ModelsDevProviderID ¶
func ModelsDevProviderID(provider providercatalog.Descriptor) string
Types ¶
type FetchOptions ¶
type Model ¶
type Model struct {
ID string
Description string
ContextWindow int
ToolCall bool
Reasoning bool
InputModalities []string
OutputModalities []string
InputCost float64
OutputCost float64
Tags []string
Source string
}
func FetchModelsDev ¶
func FetchOpenGateway ¶
func FetchRemote ¶
func FetchRemote(ctx context.Context, provider providercatalog.Descriptor, options FetchOptions) ([]Model, error)
func FilterModelsForProvider ¶ added in v0.3.0
FilterModelsForProvider filters a model slice by ModelIDAllowedForProvider.
func Models ¶
func Models(provider providercatalog.Descriptor) []Model