Browse documentation

Portable .tine files default to v5 (since 0.42). --for-legacy writes v4. The .tine/ repository format is v3. tine evidence export writes v4. Formats and protocols.

Docs target stable release v0.44.0.Stable vs main checked 2026-11-07

Reference · v0.44.0

Models · Google

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:

RuntimeTypical exact baseOpenTine surface
LM Studiohttp://localhost:1234/v1LMStudio
vLLM / Unslothhttp://localhost:8000/v1VLLM / Unsloth
llama.cpphttp://localhost:8080/v1LlamaCpp
LocalAIhttp://localhost:8080/v1LocalAI
Janhttp://localhost:1337/v1Jan
llama-cpp-pythonhttp://localhost:8000/v1LlamaCppPython
MLX-LMhttp://localhost:8080/v1MLXLM
NVIDIA NIM / TensorRT-LLMhttp://localhost:8000/v1NvidiaNIM / TensorRTLLM
SGLanghttp://localhost:30000/v1SGLang
Hugging Face TGIhttp://localhost:8080/v1TGI
Open WebUIhttp://localhost:3000/apiexact base_url
LiteLLM Proxyhttp://localhost:4000/v1LiteLLM; may route paid APIs
llamafilehttp://localhost:8080/v1Llamafile
Docker Model Runnerhttp://localhost:12434/engines/v1DockerModelRunner
AMD Lemonadehttp://localhost:13305/api/v1Lemonade
mistral.rshttp://localhost:1234/v1MistralRs
TabbyAPI / ExLlamaV3http://localhost:5000/v1TabbyAPI
Xinferencehttp://localhost:9997/v1Xinference
LMDeployhttp://localhost:23333/v1LMDeploy
NVIDIA Dynamohttp://localhost:8000/v1Dynamo
Aphroditehttp://localhost:2242/v1Aphrodite
Foundry Localdynamic port; base URL requiredFoundryLocal
OpenVINO Model Server/v3; base URL requiredOVMS
GPT4Allhttp://localhost:4891/v1LocalOpenAICompatible
KoboldCpphttp://localhost:5001/v1KoboldCpp
text-generation-webuihttp://localhost:5000/v1LocalOpenAICompatible
MLC-LLM and llama-swapconfigured server base, usually /v1LocalOpenAICompatible

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.