Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.provider.catalog

Provider catalog: the one place Vis reads provider metadata.

Svar's public catalog supplies the defaults - base URLs, dialects, the placeholder keys of local presets, rate limits, model filters and pricing. A registered provider extension owns its label, preset and transport overrides, and those win over svar's defaults. It also owns its routing policy - prompt-cache tier, billing header, fast mode, refusal fallbacks and its rank in the picker and the title chain. Config, limits, the gateway, titling and the turn loop read provider facts here instead of merging svar's table or branching on provider ids themselves.

Provider catalog: the one place Vis reads provider metadata.

Svar's public catalog supplies the defaults - base URLs, dialects, the
placeholder keys of local presets, rate limits, model filters and pricing.
A registered provider extension owns its label, preset and transport
overrides, and those win over svar's defaults. It also owns its routing
policy - prompt-cache tier, billing header, fast mode, refusal fallbacks and
its rank in the picker and the title chain. Config, limits, the gateway, titling
and the turn loop read provider facts here instead of merging svar's table or
branching on provider ids themselves.
raw docstring

agent-initiator-headersclj

(agent-initiator-headers)

Headers marking a background call as started by Vis rather than a person: {header "agent"} for every provider whose policy names an :initiator-header. svar infers the initiator from message roles, so a freshly built system+user prompt looks exactly like something a person typed; without these, background traffic - auto-titles, extension helpers, one-shot ask-code!/llm-text! calls - bills like the person's own turn. A background call is routed after these are chosen, so it carries each one; a provider ignores headers it does not read.

Headers marking a background call as started by Vis rather than a person:
`{header "agent"}` for every provider whose policy names an
`:initiator-header`. svar infers the initiator from message roles, so a freshly
built system+user prompt looks exactly like something a person typed; without
these, background traffic - auto-titles, extension helpers, one-shot
`ask-code!`/`llm-text!` calls - bills like the person's own turn. A background
call is routed after these are chosen, so it carries each one; a provider
ignores headers it does not read.
sourceraw docstring

base-urlclj

(base-url pid)

Base URL for a provider id: provider extension first, svar catalog last.

Base URL for a provider id: provider extension first, svar catalog last.
sourceraw docstring

estimate-costclj

(estimate-cost model input-tokens output-tokens opts)

Estimated USD cost of a request from its input and output token counts, priced from svar's model pricing table. opts carries the cached-input and cache-creation token counts.

Estimated USD cost of a request from its input and output token counts,
priced from svar's model pricing table. `opts` carries the cached-input and
cache-creation token counts.
sourceraw docstring

labelclj

(label pid)

The label a registered provider extension gives pid, or nil.

The label a registered provider extension gives `pid`, or nil.
sourceraw docstring

model-allowlistclj

(model-allowlist provider-id)

Model ids declared by a managed provider's preset, or nil for other providers. An empty or missing managed declaration allows no models. Neither discovery nor saved configuration can widen the extension's declaration.

Model ids declared by a managed provider's preset, or nil for other providers.
An empty or missing managed declaration allows no models. Neither discovery
nor saved configuration can widen the extension's declaration.
sourceraw docstring

model-metadataclj

(model-metadata provider-id model)

Metadata for one model as provider-id serves it - capabilities, pricing and context limits - without building a router. model is a map with at least :name.

Metadata for one model as `provider-id` serves it - capabilities, pricing and
context limits - without building a router. `model` is a map with at least
`:name`.
sourceraw docstring

model-pricingclj

(model-pricing model)

Price table entry (USD per million tokens) for a model name - {:input :output :cache-read :cached-input …} - or nil when the model is not priced.

Price table entry (USD per million tokens) for a model name - `{:input
:output :cache-read :cached-input …}` - or nil when the model is not priced.
sourceraw docstring

model-visible?clj

(model-visible? provider-id model-id)

True when svar's provider-scoped model filters allow this model id.

True when svar's provider-scoped model filters allow this model id.
sourceraw docstring

normalize-modelsclj

(normalize-models priority provider)

The models of one provider entry, normalized the way svar's router does: catalog defaults, provider-scoped pricing and context limits. Builds no router and resolves no credentials.

The models of one provider entry, normalized the way svar's router does:
catalog defaults, provider-scoped pricing and context limits. Builds no
router and resolves no credentials.
sourceraw docstring

placeholder-api-keyclj

(placeholder-api-key pid)

The placeholder key svar's catalog ships for a local no-auth preset such as Ollama or LM Studio, or nil. Cloud presets have none.

The placeholder key svar's catalog ships for a local no-auth preset such as
Ollama or LM Studio, or nil. Cloud presets have none.
sourceraw docstring

policiesclj

(policies)

Every registered provider's policy as {provider-id policy}, skipping providers that declare none.

Every registered provider's policy as `{provider-id policy}`, skipping
providers that declare none.
sourceraw docstring

policyclj

(policy pid)

The routing policy the registered provider pid owns under :provider/policy (keys documented by extension.registry/provider-policy?), or {} when the provider declares none or is not registered. pid is a keyword or string id.

The routing policy the registered provider `pid` owns under `:provider/policy`
(keys documented by `extension.registry/provider-policy?`), or {} when the
provider declares none or is not registered. `pid` is a keyword or string id.
sourceraw docstring

preset-orderclj

(preset-order pid)

Sort key for pid in the canonical provider order that the 'Add Provider' picker and every provider list share: its :preset-rank, unranked last, then its label.

Sort key for `pid` in the canonical provider order that the 'Add Provider'
picker and every provider list share: its `:preset-rank`, unranked last, then
its label.
sourceraw docstring

presetsclj

(presets)

All known provider presets for the 'Add Provider' picker, in preset-order.

All known provider presets for the 'Add Provider' picker, in [[preset-order]].
sourceraw docstring

static-limitsclj

(static-limits pid)

Static request limits from svar's catalog as {:rpm n :tpm n}, each key present only when the catalog knows it.

Static request limits from svar's catalog as `{:rpm n :tpm n}`, each key
present only when the catalog knows it.
sourceraw docstring

templateclj

(template pid)

Preset descriptor for a provider id, merged from a provider extension's metadata and svar's catalog. Returns nil for unknown or intentionally removed ids.

Preset descriptor for a provider id, merged from a provider
extension's metadata and svar's catalog. Returns nil for unknown or
intentionally removed ids.
sourceraw docstring

title-providersclj

(title-providers)

Provider ids the auto-title side channel prefers, in their declared :title-rank order. Providers without a rank are left to the router.

Provider ids the auto-title side channel prefers, in their declared
`:title-rank` order. Providers without a rank are left to the router.
sourceraw docstring

with-agent-initiatorclj

(with-agent-initiator opts)

Mark opts as agent-initiated traffic. Caller headers win, so a call site that really is answering a person can still pin "user" itself.

Mark `opts` as agent-initiated traffic. Caller headers win, so a call site
that really is answering a person can still pin `"user"` itself.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close