Add LLMTR API provider

KN
12d ago
+87-8

This adds LLMTR as a builtin API provider. LLMTR is an OpenAI-compatible gateway at https://llmtr.com/v1. It serves some models from servers in Turkey (llmtr/... ids) and routes others to their upstream providers.

The change follows the NVIDIA NIM provider:

  • provider-registry.mjs: new llmtr builtin entry (https://llmtr.com/v1 + /chat/completions) and legacy preset resolution for llmtr_* / llmtrApiModelKeys.
  • openai-provider-mappings.mjs: llmtrApiKey legacy key field and group mapping.
  • config/index.mjs: llmtrApiModelKeys group ("LLMTR (API)"), six presets, llmtrApiKey default, isUsingLlmtrApiModel, and llmtr added to NEWLY_RESERVED_BUILTIN_PROVIDER_IDS so an existing custom provider named llmtr is migrated the same way as xai, nvidia-nim and mistral.
  • background/index.mjs: route the group through the OpenAI-compatible path.
  • popup/sections/GeneralPart.jsx: API key setup link for llmtr.

Presets:

  • llmtr/qwen3-8-27b (Qwen 3.8 27B, hosted in Turkey)
  • llmtr/qwen3-6-35b (Qwen 3.6 35B-A3B, hosted in Turkey)
  • llmtr/gemma-4 (Gemma 4, hosted in Turkey)
  • llmtr/trendyol-asure-12b (Trendyol Asure 12B, hosted in Turkey)
  • anthropic/claude-sonnet-5
  • deepseek/deepseek-v4-pro

None of them is enabled by default. GeneralPart.jsx gets an API key setup link for llmtr (https://llmtr.com/dashboard/keys), like the other builtin providers.

Testing:

  • Added cases to the provider registry, thin adapter, config predicate and migration tests, and added llmtr to the "all migrations completed" fixtures.
  • npm test on tests/unit: 1111 passed.
  • prettier --check and eslint on the changed files: clean. The two-line setup-link case was added afterwards and only syntax-checked (esbuild); it follows the format of the cases around it.
  • I did not build or load the extension in a browser.

No live call to LLMTR was made for this change.


Devin Review

Summary by CodeRabbit

  • New Features
    • Added LLMTR as a built-in provider, with six available models and a link to its dashboard for API key setup.
    • LLMTR sessions now use the app’s existing OpenAI-compatible API handling, including support for legacy LLMTR model names.