Skip to content

cliver-core has no config files. Every model is a ModelBinding; ModelBindings groups them by purpose. The only required purpose is llm — the chat/stream model.

from cliver_core import ModelBindings, ModelBinding, presets
bindings = ModelBindings(
llm=presets.deepseek(api_key="..."),
image=ModelBinding.image(
model="image-01",
api_key="...",
base_url="https://api.example.com/v1",
),
)
FactoryPurpose
ModelBinding.llm(...)Chat and streaming
ModelBinding.image(...)Image generation
ModelBinding.video(...)Video generation
ModelBinding.tts(...)Text-to-speech
ModelBinding.asr(...)Speech-to-text
ModelBinding.embed(...)Embeddings
ModelBinding.rerank(...)Reranking

All factories share the same endpoint fields: model, api_key, base_url, protocol ("openai" by default, or "anthropic"), provider_name, and provider (supply an existing provider instance). Media factories also accept path= to override the endpoint path.

With an exact provider_name registry hit, the default base_url comes from the registry. With no recognized brand, base_url is required — there is no implicit endpoint. Anthropic-protocol endpoints must set protocol="anthropic".

Keyword arguments beyond the shared fields become the binding’s default call options. Per-call options= in chat()/stream() overlay them — the call site wins on conflict.

llm = ModelBinding.llm(
model="deepseek-v4-flash",
api_key="...",
provider_name="deepseek",
temperature=0.2,
max_tokens=4096,
)

A binding builds its provider lazily and reuses it. await bindings.aclose() closes providers the bindings built; a provider you supplied yourself stays open.