model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Architecture

type Architecture struct {
	Modality     string `json:"modality,omitempty"`
	Tokenizer    string `json:"tokenizer,omitempty"`
	InstructType string `json:"instruct_type,omitempty"`
}

Architecture describes the underlying model family where available.

type Endpoint

type Endpoint struct {
	Name                string `json:"name,omitempty"`
	ContextLength       int    `json:"context_length,omitempty"`
	MaxCompletionTokens int    `json:"max_completion_tokens,omitempty"`
}

Endpoint identifies an endpoint a model supports.

type Info

type Info struct {
	ID                  string              `json:"id"`
	Name                string              `json:"name,omitempty"`
	CanonicalSlug       string              `json:"canonical_slug,omitempty"`
	Description         string              `json:"description,omitempty"`
	ContextLength       int                 `json:"context_length,omitempty"`
	Architecture        *Architecture       `json:"architecture,omitempty"`
	Pricing             *Pricing            `json:"pricing,omitempty"`
	TopProvider         *TopProvider        `json:"top_provider,omitempty"`
	PerRequestLimits    *PerRequestLimits   `json:"per_request_limits,omitempty"`
	SupportedParameters SupportedParameters `json:"supported_parameters,omitempty"`
	Endpoints           []Endpoint          `json:"endpoints,omitempty"`
	DefaultEndpoint     string              `json:"default_endpoint,omitempty"`
	IsModerated         bool                `json:"is_moderated,omitempty"`
	IsReasoning         bool                `json:"is_reasoning,omitempty"`
	IsFree              bool                `json:"is_free,omitempty"`
	Metadata            map[string]any      `json:"metadata,omitempty"`
}

Info describes a model returned by VLLM model discovery.

func (Info) CompletionPriceUSD

func (i Info) CompletionPriceUSD() (float64, bool)

CompletionPriceUSD returns the parsed completion price when present.

func (Info) CostTier

func (i Info) CostTier() string

CostTier reports a coarse pricing tier derived from the discovery payload.

func (Info) ImagePriceUSD

func (i Info) ImagePriceUSD() (float64, bool)

ImagePriceUSD returns the parsed image price when present.

func (Info) MaxCompletionTokens

func (i Info) MaxCompletionTokens() int

MaxCompletionTokens returns the best available completion-token ceiling across model metadata.

func (Info) MaxContextLength

func (i Info) MaxContextLength() int

MaxContextLength returns the best available context-length value across model metadata.

func (Info) PromptPriceUSD

func (i Info) PromptPriceUSD() (float64, bool)

PromptPriceUSD returns the parsed prompt price when present.

func (Info) RequestPriceUSD

func (i Info) RequestPriceUSD() (float64, bool)

RequestPriceUSD returns the parsed per-request price when present.

func (Info) SupportsImageInput

func (i Info) SupportsImageInput() bool

SupportsImageInput reports whether the model appears to accept image or multimodal input.

func (Info) SupportsImageOutput

func (i Info) SupportsImageOutput() bool

SupportsImageOutput reports whether the model appears to support generated image output.

func (Info) SupportsPromptCaching

func (i Info) SupportsPromptCaching() bool

SupportsPromptCaching reports whether cache read/write pricing is exposed.

func (Info) SupportsReasoning

func (i Info) SupportsReasoning() bool

SupportsReasoning reports whether the model exposes explicit reasoning support.

func (Info) SupportsStructuredOutput

func (i Info) SupportsStructuredOutput() bool

SupportsStructuredOutput reports whether JSON-schema style output controls are exposed.

func (Info) SupportsToolCalling

func (i Info) SupportsToolCalling() bool

SupportsToolCalling reports whether the model exposes tool-related parameters.

func (Info) SupportsWebSearch

func (i Info) SupportsWebSearch() bool

SupportsWebSearch reports whether the model metadata exposes web-search controls.

func (Info) ToModel

func (i Info) ToModel() Model

ToModel returns a stable provider-neutral projection of the model info.

type ListResponse

type ListResponse struct {
	Object        string `json:"object,omitempty"`
	Source        string `json:"source,omitempty"`
	Models        []Info `json:"models"`
	RawData       []Info `json:"data,omitempty"`
	Total         int    `json:"total"`
	Authenticated bool   `json:"authenticated"`
	Endpoint      string `json:"endpoint"`
}

ListResponse contains the full model discovery payload.

type Model

type Model struct {
	ID          string `json:"id"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Context     int    `json:"context,omitempty"`
	IsFree      bool   `json:"is_free,omitempty"`
	IsReasoning bool   `json:"is_reasoning,omitempty"`
}

Model is a stable provider-neutral wrapper for a discovered model.

type PerRequestLimits

type PerRequestLimits struct {
	PromptTokens     int `json:"prompt_tokens,omitempty"`
	CompletionTokens int `json:"completion_tokens,omitempty"`
	Images           int `json:"images,omitempty"`
}

PerRequestLimits captures model-side request limits where available.

type Pricing

type Pricing struct {
	Prompt            string `json:"prompt,omitempty"`
	Completion        string `json:"completion,omitempty"`
	Request           string `json:"request,omitempty"`
	Image             string `json:"image,omitempty"`
	InputCacheRead    string `json:"input_cache_read,omitempty"`
	InputCacheWrite   string `json:"input_cache_write,omitempty"`
	WebSearch         string `json:"web_search,omitempty"`
	InternalReasoning string `json:"internal_reasoning,omitempty"`
}

Pricing contains VLLM pricing fields as returned by the API.

type SupportedParameters

type SupportedParameters []string

SupportedParameters records provider-supported request parameters.

type TopProvider

type TopProvider struct {
	ContextLength       int  `json:"context_length,omitempty"`
	MaxCompletionTokens int  `json:"max_completion_tokens,omitempty"`
	IsModerated         bool `json:"is_moderated,omitempty"`
}

TopProvider describes provider-side limits and moderation behavior.

Jump to

Keyboard shortcuts

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