Documentation
¶
Overview ¶
Package providerprofiles contains the bounded, declarative provider-profile seam. It deliberately has no runtime, network, process, or provider-plugin dependencies; composition roots compile profiles into family adapters.
Index ¶
- Constants
- func Validate(p Profile) error
- type AccountingSource
- type Auth
- type AuthMode
- type Binding
- type CapabilityOverrides
- type Catalog
- type Certification
- type Compiled
- type CompiledProfile
- type DialectOverrides
- type DiscoveryPolicy
- type Endpoint
- type Family
- type Model
- type ModelDiscovery
- type Namespace
- type NamespaceMode
- type PathPolicy
- type Profile
- type QuirkID
- type SafeHeader
- type TokenizerAccounting
Constants ¶
const ( APIVersionV1 = "lip.provider-profile/v1" MaxStringBytes = 256 MaxHeaders = 16 MaxModels = 2048 MaxCapabilities = 32 MaxDialects = 32 MaxQuirks = 8 MaxCatalogProfiles = 4096 MaxCatalogBytes = 1 << 20 MaxProfileBytes = 256 << 10 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountingSource ¶
type AccountingSource string
const ( AccountingProviderReported AccountingSource = "provider_reported" AccountingProviderCountAPI AccountingSource = "provider_count_api" AccountingLocalTokenizer AccountingSource = "local_tokenizer" AccountingLocalEstimator AccountingSource = "local_estimator" )
type Binding ¶
Binding names the already-certified adapter family. It contains no factory or lifecycle function, so one family binding serves every profile.
func FamilyBinding ¶
type CapabilityOverrides ¶
type CapabilityOverrides struct {
Enable []lipapi.Capability `json:"enable,omitempty" yaml:"enable,omitempty"`
Disable []lipapi.Capability `json:"disable,omitempty" yaml:"disable,omitempty"`
}
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
func EmbeddedCatalog ¶
EmbeddedCatalog loads the checked-in catalog without network or process work.
func NewCatalog ¶
func (*Catalog) CompileAll ¶
func (c *Catalog) CompileAll() ([]CompiledProfile, error)
type Certification ¶
type Certification struct {
ProfileID string
Family Family
FactoryKind string
EndpointURL string
AuthMode AuthMode
Headers []SafeHeader
ModelNamespace Namespace
StaticModels []Model
Capabilities []lipapi.Capability
Dialects lipapi.DialectSupport
Quirks []QuirkID
}
func Certify ¶
func Certify(p Profile) (Certification, error)
func (Certification) Validate ¶
func (c Certification) Validate() error
type Compiled ¶
type Compiled struct {
Profile Profile
FamilyMax lipapi.BackendCaps
Capabilities lipapi.BackendCaps
Dialects lipapi.DialectSupport
}
type CompiledProfile ¶
type CompiledProfile struct {
Profile Profile
Binding Binding
Capabilities lipapi.BackendCaps
Dialects lipapi.DialectSupport
}
CompiledProfile is the immutable composition input produced by validation. Static profile values are copied so catalog callers cannot mutate a compiled generation through their original slices.
func CompileProfile ¶
func CompileProfile(p Profile) (CompiledProfile, error)
type DialectOverrides ¶
type DialectOverrides struct {
Item []lipapi.DialectRequirement `json:"items,omitempty" yaml:"items,omitempty"`
Reasoning []lipapi.DialectRequirement `json:"reasoning,omitempty" yaml:"reasoning,omitempty"`
Compaction []lipapi.DialectRequirement `json:"compaction,omitempty" yaml:"compaction,omitempty"`
Extensions []lipapi.ExtensionRequirement `json:"extensions,omitempty" yaml:"extensions,omitempty"`
}
type DiscoveryPolicy ¶
type DiscoveryPolicy string
const ( DiscoveryFamilyDefault DiscoveryPolicy = "family_default" DiscoveryStatic DiscoveryPolicy = "static" DiscoveryDisabled DiscoveryPolicy = "disabled" )
type Endpoint ¶
type Endpoint struct {
BaseURL string `json:"base_url" yaml:"base_url"`
PathPolicy PathPolicy `json:"path_policy" yaml:"path_policy"`
}
type ModelDiscovery ¶
type ModelDiscovery struct {
Policy DiscoveryPolicy `json:"discovery" yaml:"discovery"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Namespace Namespace `json:"namespace" yaml:"namespace"`
Static []Model `json:"static,omitempty" yaml:"static,omitempty"`
}
type Namespace ¶
type Namespace struct {
Mode NamespaceMode `json:"mode" yaml:"mode"`
Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
}
type NamespaceMode ¶
type NamespaceMode string
const ( NamespacePreserve NamespaceMode = "preserve" NamespacePrefix NamespaceMode = "prefix" NamespaceStrip NamespaceMode = "strip_prefix" )
type PathPolicy ¶
type PathPolicy string
const PathPolicyFamilyDefault PathPolicy = "family_default"
type Profile ¶
type Profile struct {
APIVersion string `json:"api_version" yaml:"api_version"`
ID string `json:"id" yaml:"id"`
Family Family `json:"family" yaml:"family"`
Endpoint Endpoint `json:"endpoint" yaml:"endpoint"`
Auth Auth `json:"auth" yaml:"auth"`
Headers []SafeHeader `json:"headers,omitempty" yaml:"headers,omitempty"`
Models ModelDiscovery `json:"models" yaml:"models"`
Tokenizer TokenizerAccounting `json:"tokenizer" yaml:"tokenizer"`
Capabilities CapabilityOverrides `json:"capabilities" yaml:"capabilities"`
Dialects DialectOverrides `json:"dialects" yaml:"dialects"`
Quirks []QuirkID `json:"quirks,omitempty" yaml:"quirks,omitempty"`
// Transform is intentionally rejected. Keeping this field makes the boundary
// explicit when decoding future data rather than silently accepting a DSL.
Transform string `json:"transform,omitempty" yaml:"transform,omitempty"`
}
func DecodeJSON ¶
DecodeJSON decodes one profile with a closed field set.
func DecodeYAML ¶
DecodeYAML decodes one profile with a closed field set.
func EmbeddedProfile ¶
type QuirkID ¶
type QuirkID string
QuirkID identifies bounded family-owned behavior implemented by the corresponding adapter. Unsupported identifiers fail closed during validation.
type SafeHeader ¶
type TokenizerAccounting ¶
type TokenizerAccounting struct {
TokenizerID string `json:"id,omitempty" yaml:"id,omitempty"`
Source AccountingSource `json:"source,omitempty" yaml:"source,omitempty"`
}