From b452980be5e8c90fe9a6e7f80ce0337adb93af6a Mon Sep 17 00:00:00 2001 From: hedging8563 <45883076+hedging8563@users.noreply.github.com> Date: Thu, 9 Jul 2026 02:45:13 +0800 Subject: [PATCH 1/2] feat: add TokenLab provider --- .../llm/llms/OpenAI-compatible-core.vitest.ts | 6 ++ core/llm/llms/TokenLab.ts | 18 +++++ core/llm/llms/index.ts | 2 + .../model-providers/more/tokenlab.mdx | 67 +++++++++++++++++++ docs/customize/model-providers/overview.mdx | 1 + 5 files changed, 94 insertions(+) create mode 100644 core/llm/llms/TokenLab.ts create mode 100644 docs/customize/model-providers/more/tokenlab.mdx diff --git a/core/llm/llms/OpenAI-compatible-core.vitest.ts b/core/llm/llms/OpenAI-compatible-core.vitest.ts index 5d96d099099..534c2325934 100644 --- a/core/llm/llms/OpenAI-compatible-core.vitest.ts +++ b/core/llm/llms/OpenAI-compatible-core.vitest.ts @@ -14,6 +14,7 @@ import Cerebras from "./Cerebras.js"; import DeepInfra from "./DeepInfra.js"; import Nvidia from "./Nvidia.js"; import CometAPI from "./CometAPI.js"; +import TokenLab from "./TokenLab.js"; // Base OpenAI tests import { afterEach, describe, expect, test, vi } from "vitest"; @@ -240,6 +241,11 @@ createOpenAISubclassTests(xAI, { modelConversionContent: "hello", }); +createOpenAISubclassTests(TokenLab, { + providerName: "tokenlab", + defaultApiBase: "https://api.tokenlab.sh/v1/", +}); + createOpenAISubclassTests(Mistral, { providerName: "mistral", defaultApiBase: "https://api.mistral.ai/v1/", diff --git a/core/llm/llms/TokenLab.ts b/core/llm/llms/TokenLab.ts new file mode 100644 index 00000000000..a71c7dadcd3 --- /dev/null +++ b/core/llm/llms/TokenLab.ts @@ -0,0 +1,18 @@ +import { LLMOptions } from "../../index.js"; + +import OpenAI from "./OpenAI.js"; + +class TokenLab extends OpenAI { + static providerName = "tokenlab"; + static defaultOptions: Partial = { + apiBase: "https://api.tokenlab.sh/v1/", + model: "gpt-5.5", + useLegacyCompletionsEndpoint: false, + }; + + supportsCompletions(): boolean { + return false; + } +} + +export default TokenLab; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 4978f0617f2..450e4666946 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -59,6 +59,7 @@ import SambaNova from "./SambaNova"; import Scaleway from "./Scaleway"; import SiliconFlow from "./SiliconFlow"; import Tensorix from "./Tensorix"; +import TokenLab from "./TokenLab"; import TARS from "./TARS"; import TestLLM from "./Test"; import TextGenWebUI from "./TextGenWebUI"; @@ -125,6 +126,7 @@ export const LLMClasses = [ xAI, SiliconFlow, Tensorix, + TokenLab, Scaleway, Relace, Inception, diff --git a/docs/customize/model-providers/more/tokenlab.mdx b/docs/customize/model-providers/more/tokenlab.mdx new file mode 100644 index 00000000000..2d96e524353 --- /dev/null +++ b/docs/customize/model-providers/more/tokenlab.mdx @@ -0,0 +1,67 @@ +--- +title: TokenLab +slug: ../tokenlab +--- + +TokenLab provides a unified AI gateway for GPT, Claude, Gemini, Grok, DeepSeek, GLM, Qwen, Kimi, MiniMax, and other model families. + + + Get an API key from [TokenLab](https://tokenlab.sh/) and see API details in the [TokenLab docs](https://docs.tokenlab.sh/introduction). + + +## Configuration + +Continue uses TokenLab's OpenAI-compatible chat endpoint. TokenLab also exposes native endpoints for Responses, Anthropic Messages, Gemini generateContent, embeddings, images, videos, audio, realtime, and translations for applications that call those APIs directly. + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: GPT-5.5 + provider: tokenlab + model: gpt-5.5 + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "GPT-5.5", + "provider": "tokenlab", + "model": "gpt-5.5", + "apiKey": "" + } + ] + } + ``` + + + +## Example Models + +Common TokenLab model IDs include: + +- `gpt-5.5` +- `gpt-5.4` +- `gpt-5.4-mini` +- `claude-sonnet-5` +- `claude-opus-4-8` +- `claude-fable-5` +- `gemini-3.5-flash` +- `gemini-3.1-flash-lite` +- `grok-4.3` +- `grok-4-fast` +- `deepseek-v4-pro` +- `deepseek-v4-flash` +- `glm-5.2` +- `qwen3.7-max` +- `kimi-k2.7-code` +- `minimax-m3` + +TokenLab's full model catalog is available from `https://api.tokenlab.sh/v1/models`. diff --git a/docs/customize/model-providers/overview.mdx b/docs/customize/model-providers/overview.mdx index 7ba030dcb4d..953c3bd429f 100644 --- a/docs/customize/model-providers/overview.mdx +++ b/docs/customize/model-providers/overview.mdx @@ -35,6 +35,7 @@ Beyond the top-level providers, Continue supports many other options: | [DeepInfra](/customize/model-providers/more/deepinfra) | Hosting for various open source models | | [OpenRouter](/customize/model-providers/top-level/openrouter) | Gateway to multiple model providers | | [ClawRouter](/customize/model-providers/more/clawrouter) | Open-source LLM router with automatic cost-optimized model selection | +| [TokenLab](/customize/model-providers/more/tokenlab) | Unified gateway for GPT, Claude, Gemini, Grok, DeepSeek, Qwen, Kimi, MiniMax, and more | | [Tetrate Agent Router Service](/customize/model-providers/top-level/tetrate_agent_router_service) | Gateway with intelligent routing across multiple model providers | | [Cohere](/customize/model-providers/more/cohere) | Models specialized for semantic search and text generation | | [NVIDIA](/customize/model-providers/more/nvidia) | GPU-accelerated model hosting | From 6806b2e5667dd764a0db10ce2f9a5e5bdfef80f0 Mon Sep 17 00:00:00 2001 From: hedging8563 Date: Thu, 9 Jul 2026 15:40:08 +0800 Subject: [PATCH 2/2] chore: refresh CI checks