teff.provider.builtin.base¶
teff.provider.builtin.base
¶
The :class:Provider value object.
A provider is a named model endpoint: how to speak to it (type selects
the wire protocol) and where it lives (base_url / chat_path / auth
keys). Built-in presets are subclasses that set the defaults; custom
providers are plain instances declared in a workflow's providers: block
or passed to graph.run(providers=...).
Classes:
| Name | Description |
|---|---|
Provider |
A named model endpoint: wire protocol + endpoint data. |
Provider
¶
A named model endpoint: wire protocol + endpoint data.
name is the registry key used by provider= references.
type is the protocol discriminator — openai_compatible /
anthropic_compatible / ollama — and decides the request body,
streaming chunk parsing, and response extraction held by
:class:~teff.harness.Harness.
Built-in presets subclass this and set name (and the other fields)
once; a custom provider is a plain instance. Fields may be overridden
at construction:
Provider(name="my-vllm", type="openai_compatible", base_url="http://vllm:8000/v1")
type is deliberately a distinct concept from name: the name is
just a key and never carries protocol meaning.
Methods:
| Name | Description |
|---|---|
from_mapping |
Build from a config dict, keeping only known fields. |
to_dict |
All provider fields as a plain dict (for YAML serialisation). |
Source code in teff/provider/builtin/base.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
from_mapping
classmethod
¶
from_mapping(cfg)
Build from a config dict, keeping only known fields.
Source code in teff/provider/builtin/base.py
58 59 60 61 | |
to_dict
¶
to_dict()
All provider fields as a plain dict (for YAML serialisation).
Source code in teff/provider/builtin/base.py
63 64 65 | |