teff.provider.builtin¶
teff.provider.builtin
¶
Built-in provider presets — subclasses of :class:Provider.
Modules:
| Name | Description |
|---|---|
anthropic |
Anthropic preset (responses normalised to a shared message shape). |
base |
The :class: |
deepseek |
DeepSeek preset. |
gemini |
Gemini preset (Google's OpenAI-compatible endpoint). |
groq |
Groq preset. |
mistral |
Mistral preset. |
ollama |
Ollama preset (local). |
openai |
AI provider presets (subclasses of :class: |
openai_compatible |
Generic OpenAI-compatible provider (vLLM, LM Studio, Azure, ...). |
openrouter |
OpenRouter preset. |
together |
Together preset. |
Classes:
| Name | Description |
|---|---|
Anthropic |
Anthropic |
DeepSeek |
DeepSeek's OpenAI-compatible endpoint. |
Gemini |
Google's |
Groq |
Groq's OpenAI-compatible endpoint. |
Mistral |
Mistral's OpenAI-compatible endpoint. |
Ollama |
Ollama's local |
OpenAI |
OpenAI chat-completions endpoint. |
OpenAICompatible |
Any |
OpenRouter |
OpenRouter's OpenAI-compatible endpoint. |
Provider |
A named model endpoint: wire protocol + endpoint data. |
Together |
Together.ai's OpenAI-compatible endpoint. |
Anthropic
¶
Bases: Provider
Anthropic /messages endpoint.
Source code in teff/provider/builtin/anthropic.py
6 7 8 9 10 11 12 13 14 15 | |
DeepSeek
¶
Bases: Provider
DeepSeek's OpenAI-compatible endpoint.
Source code in teff/provider/builtin/deepseek.py
6 7 8 9 10 11 | |
Gemini
¶
Bases: Provider
Google's openai protocol endpoint.
Source code in teff/provider/builtin/gemini.py
6 7 8 9 10 11 | |
Groq
¶
Bases: Provider
Groq's OpenAI-compatible endpoint.
Source code in teff/provider/builtin/groq.py
6 7 8 9 10 11 | |
Mistral
¶
Bases: Provider
Mistral's OpenAI-compatible endpoint.
Source code in teff/provider/builtin/mistral.py
6 7 8 9 10 11 | |
Ollama
¶
Bases: Provider
Ollama's local /api/chat endpoint.
Source code in teff/provider/builtin/ollama.py
6 7 8 9 10 11 12 13 14 15 | |
OpenAI
¶
Bases: Provider
OpenAI chat-completions endpoint.
Source code in teff/provider/builtin/openai.py
6 7 8 9 10 11 | |
OpenAICompatible
¶
Bases: Provider
Any /chat/completions endpoint; set base_url yourself.
Source code in teff/provider/builtin/openai_compatible.py
6 7 8 9 10 11 | |
OpenRouter
¶
Bases: Provider
OpenRouter's OpenAI-compatible endpoint.
Source code in teff/provider/builtin/openrouter.py
6 7 8 9 10 11 | |
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 | |