Documentation
¶
Overview ¶
Package coremodels opens a provider profile: it resolves the profile against the environment, picks the dialect its server speaks, and hands back a Provider whose models are llm.LLMs.
p, err := coremodels.Open(ctx, prof, coremodels.Options{})
m, err := p.Model(ctx, "Qwen/Qwen3-Coder-Next")
Everything that can fail before a request — an unknown dialect, a missing variable, absent credentials, a model the profile does not serve — fails here, naming the profile (requirement R1).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Resolve is passed to profile.Resolve.
Resolve profile.Options
// HTTPClient supplies the base transport and timeout. Nil means a
// client with http.DefaultTransport.
HTTPClient *http.Client
// Retry overrides the HTTP-layer retry policy.
Retry *retry.Policy
}
Options adjusts Open.
type Provider ¶
type Provider interface {
// Name is the profile's name.
Name() string
// Backend is the identity prices are keyed on, beside the model id.
Backend() string
// Model returns a model the profile serves, and refuses one it
// does not.
Model(ctx context.Context, id string) (llm.LLM, error)
// DefaultSmallModel is the profile's small-tier model, or "".
DefaultSmallModel() string
// Capabilities are what the profile declares its server honors.
Capabilities() profile.Capabilities
// Profile is the resolved profile, extends applied.
Profile() profile.Profile
}
Provider is an opened profile.
Directories
¶
| Path | Synopsis |
|---|---|
|
adkv1
module
|
|
|
adkv2
module
|
|
|
Package auth resolves the credential a provider profile declares.
|
Package auth resolves the credential a provider profile declares. |
|
Package callctx is the per-call vocabulary adapters and products share through a context.Context.
|
Package callctx is the per-call vocabulary adapters and products share through a context.Context. |
|
dialect
|
|
|
openaichat
Package openaichat is the openai-chat dialect: POST {base_url}/chat/completions, the wire shape Vertex AI's partner models, xAI, vLLM, SGLang, Ollama, llama.cpp, NVIDIA NIM and the managed long tail all speak (docs/design.md §7.1).
|
Package openaichat is the openai-chat dialect: POST {base_url}/chat/completions, the wire shape Vertex AI's partner models, xAI, vLLM, SGLang, Ollama, llama.cpp, NVIDIA NIM and the managed long tail all speak (docs/design.md §7.1). |
|
Package llm is the contract every core-models provider adapter implements.
|
Package llm is the contract every core-models provider adapter implements. |
|
Package profile declares how to reach a model: endpoint, credential, wire dialect, capabilities, and the models served.
|
Package profile declares how to reach a model: endpoint, credential, wire dialect, capabilities, and the models served. |
|
Package retry retries model calls at the HTTP layer, where a provider's rate-limit headers are still visible.
|
Package retry retries model calls at the HTTP layer, where a provider's rate-limit headers are still visible. |
|
Package toolwire states the invariant every provider adapter is held to: each tool a model is offered arrives on the wire with every argument it declares, with the required ones still required, and with each argument's own schema intact.
|
Package toolwire states the invariant every provider adapter is held to: each tool a model is offered arrives on the wire with every argument it declares, with the required ones still required, and with each argument's own schema intact. |
|
Package usage is the normalized usage record a core-models adapter attaches to every Response, beside genai's UsageMetadata.
|
Package usage is the normalized usage record a core-models adapter attaches to every Response, beside genai's UsageMetadata. |
Click to show internal directories.
Click to hide internal directories.