feat(providers): add TARS (Tetrate Agent Router Service) as a built-in inference provider - #2535
Open
zhaohuabing wants to merge 2 commits into
Open
feat(providers): add TARS (Tetrate Agent Router Service) as a built-in inference provider#2535zhaohuabing wants to merge 2 commits into
zhaohuabing wants to merge 2 commits into
Conversation
…n inference provider - Adds `tars` as a built-in Providers v2 profile (`providers/tars.yaml`) with inference category, Bearer auth, and TARS_API_KEY / AGENTROUTER_API_KEY discovery - Adds `TARS_PROFILE` to inference routing so `inference.local` works with the `tars` provider type. TARS serves OpenAI-compatible endpoints and the Anthropic Messages API on the same host, so the profile advertises both protocol families on a single route (precedent: google-vertex-ai) — OpenAI-SDK tools and Anthropic clients work in the same sandbox with one configured provider - Default base URL is the Tetrate-hosted SaaS gateway (https://api.router.tetrate.ai/v1); enterprise deployments override it with `--config TARS_BASE_URL` (precedent: deepinfra's vendor default) - Passes through anthropic-version, anthropic-beta, openai-organization, and x-model-id client headers - Registers a tars provider plugin (discovery, known_types(), TUI), a Tars telemetry bucket, and normalize aliases (tars, agentrouter, tetrate-agent-router) - Updates providers-v2.mdx, manage-providers.mdx, and architecture/gateway.md provider lists Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
zhaohuabing
marked this pull request as ready for review
July 29, 2026 07:57
zhaohuabing
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
July 29, 2026 07:57
Verified each protocol the TARS profile advertises against the live endpoint. `POST /v1/completions` answers "Unsupported endpoint", so drop `openai_completions` from the profile; chat completions, responses, embeddings, and Anthropic messages all serve. Record why `default_headers` stays empty on a dual-family profile: route default headers apply to every request on the route regardless of protocol, so injecting `anthropic-version` would also stamp it onto the OpenAI-family paths TARS serves from the same base URL. Add the `tars` row to the debug-inference skill, the TARS passthrough set to the inference-routing header table, and the `agentrouter` / `tetrate-agent-router` aliases to the provider table, with a normalize_provider_type test pinning them. Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds TARS (Tetrate Agent Router Service) as a built-in inference provider, following the DeepInfra precedent (#1902). TARS is a multi-tenant LLM traffic router that fronts ~200 models across upstream providers behind one endpoint, with server-side model routing, fallback chains, BYOK, budget enforcement, and per-key usage attribution.
One
tarsprovider entry gives sandboxes all of that throughinference.local, with the TARS key injected at the supervisor proxy and never present in the sandbox environment.Related Issue
Changes
crates/openshell-core/src/inference.rs—TARS_PROTOCOLS,TARS_PROFILE, normalize/profile arms, 3 new tests (+tarsadded to the OpenAI-embeddings contract test)providers/tars.yaml— Providers v2 profile (inference category, bearer credential, SaaS endpoint for policy injection)crates/openshell-providers— discovery spec (TARS_API_KEY,AGENTROUTER_API_KEY), registry + built-in YAML registrationcrates/openshell-core/src/telemetry.rs+crates/openshell-server/src/grpc/provider.rs—Tarstelemetry bucketcrates/openshell-server/src/inference.rs— supported-types error messageproviders-v2.mdx,manage-providers.mdx,architecture/gateway.mdTesting
mise run pre-commitpassesChecklist