diff --git a/core/llm/llms/Tokenmix.ts b/core/llm/llms/Tokenmix.ts new file mode 100644 index 00000000000..e741014c768 --- /dev/null +++ b/core/llm/llms/Tokenmix.ts @@ -0,0 +1,14 @@ +import OpenAI from "./OpenAI.js"; + +import type { LLMOptions } from "../../index.js"; + +class Tokenmix extends OpenAI { + static providerName = "tokenmix"; + static defaultOptions: Partial = { + apiBase: "https://api.tokenmix.ai/v1/", + model: "deepseek/deepseek-v4-pro", + useLegacyCompletionsEndpoint: false, + }; +} + +export default Tokenmix; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 4978f0617f2..02ed8e5b371 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -63,6 +63,7 @@ import TARS from "./TARS"; import TestLLM from "./Test"; import TextGenWebUI from "./TextGenWebUI"; import Together from "./Together"; +import Tokenmix from "./Tokenmix"; import Venice from "./Venice"; import VertexAI from "./VertexAI"; import Vllm from "./Vllm"; @@ -125,6 +126,7 @@ export const LLMClasses = [ xAI, SiliconFlow, Tensorix, + Tokenmix, Scaleway, Relace, Inception, diff --git a/docs/customize/model-providers/more/tokenmix.mdx b/docs/customize/model-providers/more/tokenmix.mdx new file mode 100644 index 00000000000..4885ed35740 --- /dev/null +++ b/docs/customize/model-providers/more/tokenmix.mdx @@ -0,0 +1,93 @@ +--- +title: "TokenMix" +description: "Configure TokenMix with Continue to access DeepSeek, Qwen, Kimi, GLM, MiniMax, and other models through a single OpenAI-compatible API gateway" +--- + +[TokenMix](https://tokenmix.ai) is an OpenAI-compatible API gateway that provides access to DeepSeek, Qwen, Kimi, GLM, MiniMax, and other models through one endpoint and one API key. Pay-as-you-go with no subscription required. + + + You can get an API key from + [tokenmix.ai](https://tokenmix.ai). + + +## Chat Model + +We recommend configuring **deepseek/deepseek-v4-pro** as your chat model. + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: DeepSeek V4 Pro + provider: tokenmix + model: deepseek/deepseek-v4-pro + apiKey: + roles: + - chat + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek V4 Pro", + "provider": "tokenmix", + "model": "deepseek/deepseek-v4-pro", + "apiKey": "" + } + ] + } + ``` + + + +## Autocomplete Model + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: DeepSeek V4 Pro + provider: tokenmix + model: deepseek/deepseek-v4-pro + apiKey: + roles: + - autocomplete + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek V4 Pro", + "provider": "tokenmix", + "model": "deepseek/deepseek-v4-pro", + "apiKey": "" + } + ], + "tabAutocompleteModel": { + "title": "DeepSeek V4 Pro", + "provider": "tokenmix", + "model": "deepseek/deepseek-v4-pro", + "apiKey": "" + } + } + ``` + + + +## Embeddings Model + +TokenMix provides access to various models. [Click here](https://tokenmix.ai/models) to see a list of available models. + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Tokenmix.ts) diff --git a/docs/docs.json b/docs/docs.json index b7a1d83f13a..849ab9ab751 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -119,6 +119,7 @@ "customize/model-providers/more/nvidia", "customize/model-providers/more/tensorix", "customize/model-providers/more/together", + "customize/model-providers/more/tokenmix", "customize/model-providers/more/xAI", "customize/model-providers/more/zai" ] diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 9e2aba08c5c..43cd84b6ebc 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -1270,6 +1270,26 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo packages: [{ ...models.AUTODETECT }], apiKeyUrl: "https://app.tensorix.ai", }, + tokenmix: { + title: "TokenMix", + provider: "tokenmix", + description: + "TokenMix is an OpenAI-compatible API gateway with access to DeepSeek, Qwen, Kimi, GLM, MiniMax, and other models.", + longDescription: + "To get started with TokenMix, create an account and get an API key at [tokenmix.ai](https://tokenmix.ai).", + tags: [ModelProviderTags.RequiresApiKey], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your TokenMix API key", + required: true, + }, + ], + packages: [{ ...models.AUTODETECT }], + apiKeyUrl: "https://tokenmix.ai", + }, venice: { title: "Venice", provider: "venice", diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index 52fb2d33a0c..8f42bbc9ea4 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -176,6 +176,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("https://api.function.network/v1/", config); case "tensorix": return openAICompatible("https://api.tensorix.ai/v1/", config); + case "tokenmix": + return openAICompatible("https://api.tokenmix.ai/v1/", config); case "openrouter": return new OpenRouterApi(config); case "clawrouter": diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index 14b9512f75b..d70ac3781d4 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -60,6 +60,7 @@ export const OpenAIConfigSchema = BasePlusConfig.extend({ z.literal("zAI"), z.literal("scaleway"), z.literal("tensorix"), + z.literal("tokenmix"), z.literal("ncompass"), z.literal("relace"), z.literal("huggingface-inference-api"),