Skip to content

feat(provider): add built-in LLMTR gateway provider - #10

Open
knowhycodata wants to merge 1 commit into
s0ld13rr:mainfrom
knowhycodata:feat/llmtr-provider
Open

feat(provider): add built-in LLMTR gateway provider#10
knowhycodata wants to merge 1 commit into
s0ld13rr:mainfrom
knowhycodata:feat/llmtr-provider

Conversation

@knowhycodata

Copy link
Copy Markdown

Closes #9

What

Adds LLMTR — a Turkey-hosted, OpenAI-compatible AI gateway (200+ models, global + Turkey-hosted with data-residency guarantee) — as a built-in provider. It plugs in like the other gateway providers (openrouter/nvidia/zenmux): an @ai-sdk/openai-compatible provider at https://llmtr.com/v1 whose bearer key is resolved from a new llmtr integration.

Changes

  • packages/core/src/plugin/provider/llmtr.ts — new provider plugin:
    • Injects the llmtr provider into the catalog (@ai-sdk/openai-compatible, url https://llmtr.com/v1, branding headers).
    • Registers an llmtr integration with API-key + env (LLMTR_API_KEY) auth methods.
    • Discovers the model catalog live from the public /v1/models endpoint (OpenRouter-style schema): converts per-token pricing → per-1M cost, maps modalities, tool support (supported_parameters), and context/output limits.
    • Best-effort, forked fetch (never blocks registration) with a curated offline seed of Turkey-hosted flagship models.
    • LLMTR_BASE_URL overrides the endpoint; LLMTR_SKIP_REMOTE_MODELS=1 disables the live fetch (used by the test).
  • packages/core/src/plugin/provider.ts — register LLMTRPlugin in ProviderPlugins.
  • packages/core/test/plugin/provider-llmtr.test.ts — hermetic tests: registration, provider api/headers, integration key+env methods, seed model pricing conversion & tool detection.
  • README.md — LLMTR configuration section.

Usage

pentestcode auth login    # pick "LLMTR", paste API key   (or export LLMTR_API_KEY=...)
{ "provider": { "llmtr": { "model": "openai/gpt-5.5" } } }

Verification

  • tsgo --noEmit (core) — clean.
  • bun test test/plugin/217 pass / 0 fail (incl. 4 new).

🤖 Generated with Claude Code

LLMTR (https://llmtr.com) is a Turkey-hosted, OpenAI-compatible AI gateway
fronting 200+ models (global providers + Turkey-hosted models with a
data-residency guarantee) behind a single endpoint.

- New `llmtr` provider plugin injects an `@ai-sdk/openai-compatible` provider
  into the catalog (url https://llmtr.com/v1), mirroring the openrouter/nvidia/
  zenmux gateway pattern. Bearer key resolves from the `llmtr` integration.
- Registers an `llmtr` integration with API-key + env (`LLMTR_API_KEY`) auth.
- Discovers the model catalog live from the public `/v1/models` endpoint
  (OpenRouter-style schema), converting per-token pricing to per-1M cost and
  mapping modalities/tool support/limits. Curated offline seed of Turkey-hosted
  flagships keeps the provider usable without network. `LLMTR_BASE_URL` overrides
  the endpoint; `LLMTR_SKIP_REMOTE_MODELS=1` disables the live fetch.
- Adds hermetic test coverage and a README section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add built-in LLMTR (Turkey-hosted, OpenAI-compatible) gateway provider

1 participant