models

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package models provides model classification utilities shared across the client and provider packages. It consolidates endpoint type detection and model-specific classification logic to avoid duplication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAnthropicModel

func IsAnthropicModel(modelID string) bool

IsAnthropicModel returns true if the Go provider model requires the Anthropic endpoint. Most Go provider models use the Chat Completions transform path for broader compatibility (tool format, message roles, etc.). Exceptions are models whose upstream backends don't support the OpenAI Chat Completions format and only accept Anthropic Messages format.

Only Zen models use the raw Anthropic endpoint via ClassifyEndpoint.

func IsGeminiModel

func IsGeminiModel(modelID string) bool

IsGeminiModel returns true for models using the Gemini endpoint.

func IsResponsesModel

func IsResponsesModel(modelID string) bool

IsResponsesModel returns true for models using the OpenAI Responses endpoint.

func IsZenAnthropicModel

func IsZenAnthropicModel(modelID string) bool

IsZenAnthropicModel returns true for models on Zen that use the Anthropic endpoint.

Types

type EndpointType

type EndpointType int

EndpointType determines which API endpoint format to use for a model.

const (
	// EndpointChatCompletions is the OpenAI-compatible /v1/chat/completions endpoint.
	EndpointChatCompletions EndpointType = iota
	// EndpointAnthropic is the Anthropic /v1/messages endpoint.
	EndpointAnthropic
	// EndpointResponses is the OpenAI native /v1/responses endpoint.
	EndpointResponses
	// EndpointGemini is the Google Gemini /v1/models/{id} endpoint.
	EndpointGemini
)

func ClassifyEndpoint

func ClassifyEndpoint(modelID string) EndpointType

ClassifyEndpoint determines the endpoint type for a model on Zen. This is Zen-specific: minimax models use chat completions on Zen (they use Anthropic only on the Go provider).

Jump to

Keyboard shortcuts

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