From 9ecf92a95b22d67900e0e662f37ff8260aebf9f7 Mon Sep 17 00:00:00 2001 From: Magnus <34772565+magnus-minor@users.noreply.github.com> Date: Wed, 14 Oct 2026 21:50:53 +0800 Subject: [PATCH] docs: add Modelflare custom endpoint example --- .../librechat_yaml/ai_endpoints/meta.json | 1 + .../ai_endpoints/modelflare.mdx | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 content/docs/configuration/librechat_yaml/ai_endpoints/modelflare.mdx diff --git a/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json b/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json index c46fe3dfd..33b53b51b 100644 --- a/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json +++ b/content/docs/configuration/librechat_yaml/ai_endpoints/meta.json @@ -17,6 +17,7 @@ "litellm", "mistral", "mlx", + "modelflare", "moonshot", "nearai", "neurochain", diff --git a/content/docs/configuration/librechat_yaml/ai_endpoints/modelflare.mdx b/content/docs/configuration/librechat_yaml/ai_endpoints/modelflare.mdx new file mode 100644 index 000000000..1969d456d --- /dev/null +++ b/content/docs/configuration/librechat_yaml/ai_endpoints/modelflare.mdx @@ -0,0 +1,41 @@ +--- +title: Modelflare +icon: Plug +description: Configure Modelflare as a custom endpoint in LibreChat. +--- + +[Modelflare](https://modelflare.dev) is an AI API gateway that serves chat models from several providers through one OpenAI-compatible endpoint and one API key. See the [Modelflare docs](https://docs.modelflare.dev) for details. + +## Get an API key + +Create an account at [modelflare.dev](https://modelflare.dev) and create a key on the [API Keys page](https://modelflare.dev/keys). A Smart API Key can call every model available to your account. A regular key only calls the models of its own group. Add the key to your `.env` file: + +```bash filename=".env" +MODELFLARE_API_KEY=your-api-key +``` + +## Configuration + +Add the endpoint to the `custom` list under `endpoints` in your `librechat.yaml`. If your file already has an `endpoints.custom` list, paste only the `- name:` entry into it, keeping the same indentation: + +```yaml filename="librechat.yaml" +endpoints: + custom: + - name: "Modelflare" + apiKey: "${MODELFLARE_API_KEY}" + baseURL: "https://modelflare.dev/v1" + models: + default: ["gpt-5.6-sol"] + fetch: true + titleConvo: true + titleModel: "current_model" + modelDisplayLabel: "Modelflare" +``` + +To let each user supply their own key through the LibreChat UI instead of reading one from `.env`, set `apiKey: "user_provided"`. Users then see a key input field when they select the endpoint. + +## Notes + +- With `fetch: true`, LibreChat loads the models your key can call from `GET https://modelflare.dev/v1/models`. Use the exact model `id` from that list or from [Models & Pricing](https://modelflare.dev/pricing). +- For deployments in mainland China, `https://origin.modelflare.dev/v1` serves the same API and can be used as the `baseURL`. +- A `model_not_found` error means the key cannot reach that model. Use a Smart API Key or a key whose group includes the model.