Typhoon is the only production-ready reasoning provider in thcode’s current release. It connects directly from your machine to the officialDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Temicide/thcode/llms.txt
Use this file to discover all available pages before exploring further.
api.opentyphoon.ai endpoint using an OpenAI-compatible protocol, so provider requests never pass through a hosted thcode proxy. The provider registry enforces explicit selection with no silent fallback, ensuring the model you configured is always the model that runs.
The Provider Registry
TheProviderRegistry class owns provider lifecycle for a session. At startup, createDefaultProviderRegistry() seeds it with one fully-functional adapter (Typhoon) and three roadmap stubs (Pathumma, OpenThaiGPT, ThaLLE). The registry exposes a small, deliberate surface:
| Method / Getter | Purpose |
|---|---|
register(adapter) | Add an adapter keyed by adapter.capabilities.provider |
get(id) | Retrieve an adapter by provider id, or undefined if not registered |
list() | Return all registered adapters as an array |
select(id) | Activate a provider for the session; throws on unknown id |
selected | Get the currently active adapter; throws if the current id is unregistered |
selectedId | Get the string id of the currently active provider |
Explicit selection, no silent fallback
UnknownProviderError is thrown — never swallowed — whenever select() or selected encounters an id that has no registered adapter. The error message makes this contract explicit:
The ProviderAdapter interface
Every provider — including the roadmap stubs — implements ProviderAdapter:
capabilities is a static descriptor; availability() is computed at call time from whether a credential is present. Adapters never read the credential store themselves — the key is injected at complete() time.
Capability fields
contextLimit: null means no verified limit exists for that provider/model yet. Consumers must treat null as “unverified” and must not derive a numeric percentage or token count from it.The Typhoon Adapter
TyphoonAdapter is thcode’s only Release-1 reasoning adapter. Its static capabilities are:
OpenAI-compatible endpoint
All requests go tohttps://api.opentyphoon.ai/v1/chat/completions as streaming JSON over HTTPS. The adapter serializes the normalized message list and any tool schemas into the standard OpenAI chat-completions shape and parses the SSE stream back into a ProviderResult:
Request finalization and integrity
Beforecomplete() is called, the request must be finalized — the adapter serializes the message list to Uint8Array, computes a SHA-256 digest, and binds both to an immutable ContextManifest. When complete() runs, it re-derives the expected bytes from the same inputs and rejects any mismatch. This prevents a tampered or stale request from being dispatched silently.
Error classification
classifyError() maps HTTP status codes to retry metadata so the agent loop can handle transient failures correctly:
| Status | Kind | Retryable |
|---|---|---|
| 429 | rate-limit | Yes |
| 5xx | server | Yes |
| 401 / 403 | auth | No |
| Other 4xx | client | No |
TypeError | network | Yes |
| Other | unknown | No |
Roadmap Providers
Three additional Thai-ecosystem providers are catalogued in the registry but are not yet callable. They reportauthState: 'unconfigured' and throw ProviderUnavailableError if dispatch is attempted.
Pathumma
Model:
pathumma-llm · Context: 32,000 tokens · No endpoint configuredOpenThaiGPT
Model:
openthaigpt-1.5 · Context: 32,000 tokens · No endpoint configuredThaLLE
Model:
thalle-7b · Context: 32,000 tokens · No endpoint configuredCatalogued stub providers appear in
/models output with a unavailable: no endpoint configured reason. They cannot be selected for a reasoning turn until a real endpoint, authentication contract, and streaming parser are implemented.Provider Health Checks
thcode’s health check system is generation-bound: a provider only becomesavailable after a live probe of the exact stored configuration passes. Stale results from an older configuration generation are rejected.
Health lifecycle
unconfigured
No effective-configuration generation exists. The provider has no credential and no endpoint to verify.
configured
A credential has been stored and a configuration generation registered. The provider is ready to be health-checked but has not been proven live yet.
checking
A live probe is in flight. The provider cannot be promoted to
available by a probe that returns after a newer generation has been registered.available / unavailable / unhealthy
available — the probe passed. unavailable — a transient failure (retryable). unhealthy — a fatal failure (auth, configuration, or protocol mismatch); requires explicit correction. quarantined — credential was rejected; the provider is locked until an explicit retest passes.Typhoon health probe
The Typhoon probe makes a single authenticatedGET /models request to the configured endpoint. It validates both the HTTP status and the OpenAI-compatible response schema:
- Probe outcomes
- Probe never exposes secrets
| Cause code | Category | Retryable |
|---|---|---|
no-credential | auth | No |
auth-rejected | auth | No |
rate-limited | quota | Yes (5 s backoff) |
http-5xx | connectivity | Yes |
protocol-non-json | protocol | No |
protocol-schema-mismatch | protocol | No |
network | connectivity | Yes |
EffectiveConfigurationGeneration
The probe runs against an immutable generation object that records the endpoint, credential revision, adapter version, and model id — but never the secret:
Inspecting Providers in the CLI
/models
Lists all registered adapters with their model id, availability state, context limit (or “unverified” for
null), tool-call support, and data-handling note. Unresolved pins are labelled as such./connections
Shows provider and service health alongside connection identity. Displays the endpoint host and generation id — never the API key or secret.