Reference · v0.44.0
Models
From the pinned CLI source. Read upstream.
Model adapters
Native adapters:
from opentine.models.anthropic import Anthropic
from opentine.models.google import Google
from opentine.models.ollama import Ollama
from opentine.models.openai import OpenAI
OpenAI("gpt-6.1-sol") # native Responses API
Anthropic("claude-sonnet-5-5")
Google("gemini-3.8-flash")
Ollama("qwen3") # usage/timing retained; API is unmetered
Hosted OpenAI-compatible adapters use Chat Completions with provider-scoped usage and prices:
from opentine.models.compat import (
DeepSeek, GLM, Grok, Groq, Hermes, Kimi, Ministral,
Mistral, OpenRouter, Qwen, Together,
)
Kimi() # kimi-k3, api.moonshot.ai
DeepSeek() # deepseek-flash (V4.1-Flash)
GLM() # glm-5.3 / Z.AI global endpoint
Grok() # grok-4.7
Qwen() # qwen3.8-max international endpoint
Ministral() # ministral-14b-2512
OpenRouter() # openai/gpt-oss-120b
Hermes() # direct Nous; local price overlay expected
GLM_REGION=china (or a legacy dotted GLM key) selects the BigModel China
endpoint and provider identity glm-cn; add a regional catalog overlay rather
than applying Z.AI global USD rates to that endpoint.
OpenAI native calls use Responses API items, tool-call continuation state, refusals, and final usage. Anthropic handles cache-write buckets, reported inference geography, and adaptive sampling restrictions. Kimi omits unsupported temperature fields and preserves reasoning continuation. Google extracts usage instead of reporting zero, and Ollama retains token counts plus load/evaluation timing.
Local and generic compatible runtimes
OpenTine has native Ollama support and one exact-base OpenAI-compatible surface
for the broader local ecosystem. The named presets are conveniences, not
separate protocol forks — and each one is also a tine run --model word, so a
server already listening on localhost is one command away with no Python:
tine run --model sglang:served-model --prompt "…" # http://localhost:30000/v1
The CLI word is the preset's own recorded provider string, and the same
adapters are available in Python:
from opentine.models.compat import LMStudio, LocalOpenAICompatible, OpenAICompatible, SGLang
LMStudio("loaded-model")
SGLang("served-model")
# `base_url` is exact; it is never changed or given a second `/v1` suffix.
local = LocalOpenAICompatible(
"served-model",
base_url="http://localhost:3000/api", # for example, Open WebUI
api_key="local-secret",
supports_tools=False,
include_usage=True,
extra_body={"chat_template_kwargs": {"enable_thinking": True}},
)
# Hosted gateways default to unknown billing, not local/unmetered billing.
gateway = OpenAICompatible(
"provider/model",
base_url="https://gateway.example/openai",
api_key="gateway-secret",
)
LocalOpenAICompatible(host=...) appends /v1 once; pass base_url=... for
an exact nonstandard prefix. OpenAICompatible and custom OpenAI endpoints do
not inherit ambient proxy settings, do not follow redirects, and never forward
OPENAI_API_KEY implicitly. Use OPENAI_COMPAT_API_KEY or an explicit key.
Configured provider endpoints are trusted infrastructure: SDKs can buffer a
provider response before OpenTine applies retained-content limits.
Common compatible endpoints are:
| Runtime | Typical exact base | OpenTine surface |
|---|---|---|
| LM Studio | http://localhost:1234/v1 | LMStudio |
| vLLM / Unsloth | http://localhost:8000/v1 | VLLM / Unsloth |
| llama.cpp | http://localhost:8080/v1 | LlamaCpp |
| LocalAI | http://localhost:8080/v1 | LocalAI |
| Jan | http://localhost:1337/v1 | Jan |
| llama-cpp-python | http://localhost:8000/v1 | LlamaCppPython |
| MLX-LM | http://localhost:8080/v1 | MLXLM |
| NVIDIA NIM / TensorRT-LLM | http://localhost:8000/v1 | NvidiaNIM / TensorRTLLM |
| SGLang | http://localhost:30000/v1 | SGLang |
| Hugging Face TGI | http://localhost:8080/v1 | TGI |
| Open WebUI | http://localhost:3000/api | exact base_url |
| LiteLLM Proxy | http://localhost:4000/v1 | LiteLLM; may route paid APIs |
| llamafile | http://localhost:8080/v1 | Llamafile |
| Docker Model Runner | http://localhost:12434/engines/v1 | DockerModelRunner |
| AMD Lemonade | http://localhost:13305/api/v1 | Lemonade |
| mistral.rs | http://localhost:1234/v1 | MistralRs |
| TabbyAPI / ExLlamaV3 | http://localhost:5000/v1 | TabbyAPI |
| Xinference | http://localhost:9997/v1 | Xinference |
| LMDeploy | http://localhost:23333/v1 | LMDeploy |
| NVIDIA Dynamo | http://localhost:8000/v1 | Dynamo |
| Aphrodite | http://localhost:2242/v1 | Aphrodite |
| Foundry Local | dynamic port; base URL required | FoundryLocal |
| OpenVINO Model Server | /v3; base URL required | OVMS |
| GPT4All | http://localhost:4891/v1 | LocalOpenAICompatible |
| KoboldCpp | http://localhost:5001/v1 | KoboldCpp |
| text-generation-webui | http://localhost:5000/v1 | LocalOpenAICompatible |
| MLC-LLM and llama-swap | configured server base, usually /v1 | LocalOpenAICompatible |
Every row above that names a preset class is also a CLI provider word —
aphrodite, docker-model-runner, dynamo, foundry-local, jan,
koboldcpp, lemonade, litellm, llama-cpp-python, llamacpp,
llamafile, lmdeploy, lmstudio, localai, mistralrs, mlx-lm,
nvidia-nim, ovms, sglang, tabbyapi, tensorrt-llm, tgi, unsloth,
vllm, xinference — resolving to exactly the base above. Each preset also
reads <PRESET>_BASE_URL and <PRESET>_API_KEY (for example
LLAMACPP_BASE_URL=http://127.0.0.1:9931/v1 for llama.cpp's newer default
port, JAN_API_KEY, TABBYAPI_API_KEY), and tine run --model takes
--base-url and --api-key-env. A real key from the environment is still held
to the cleartext rule: plain http:// only to a loopback address. A hosted
preset's own key never follows --base-url to another host (--base-url on a
hosted preset needs --api-key-env), and --model anthropic --base-url sends
ANTHROPIC_COMPAT_API_KEY, never ANTHROPIC_API_KEY /
ANTHROPIC_AUTH_TOKEN; the SDKs' environment headers
(ANTHROPIC_CUSTOM_HEADERS, OPENAI_CUSTOM_HEADERS) are not sent there either.
The rows
answered by LocalOpenAICompatible or an exact base_url stay Python-only.
Reasoning a server leaves inline (<think>…</think>, [THINK], raw Harmony
channels) is split into reasoning rather than recorded as the answer.
Model IDs, tool calling, reasoning fields, multimodal input, and usage reporting
depend on the loaded model, chat template, runtime version, and server flags.
Set supports_tools=False where needed and request include_usage=True only
when the server implements final stream usage. Local API cost is unmetered by
default; supply rates= to account for infrastructure. The LiteLLM preset
and OpenAICompatible deliberately default to unknown billing because a
gateway may route paid hosted APIs.