[PR #5699] [MERGED] feat: add Cerebras as an LLM provider #5537

Closed
opened 2026-06-05 15:21:40 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5699
Author: @officialasishkumar
Created: 5/24/2026
Status: Merged
Merged: 5/27/2026
Merged by: @timothycarambat

Base: masterHead: feat/cerebras-llm-provider


📝 Commits (7)

  • 97d83ad feat: add Cerebras as an LLM provider
  • ddab3a9 use proper model fallback
  • 7fad9e9 context window reporting + better chat repsonses + show thinking
  • 466420a add Cerebrase agent tool calling, capability detection, context windows, and usage reporting
  • 151a5bc add safety caching
  • 721dc83 Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into feat/cerebras-llm-provider
  • 32588af stub out images

📊 Changes

29 files changed (+779 additions, -13 deletions)

View changed files

📝 README.md (+1 -0)
📝 docker/.env.example (+4 -0)
frontend/src/components/LLMSelection/CerebrasLLMOptions/index.jsx (+109 -0)
📝 frontend/src/components/ProviderPrivacy/constants.js (+6 -0)
frontend/src/media/llmprovider/cerebras.png (+0 -0)
📝 frontend/src/pages/GeneralSettings/LLMPreference/index.jsx (+10 -0)
📝 frontend/src/pages/OnboardingFlow/Steps/LLMPreference/index.jsx (+9 -0)
📝 frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx (+1 -0)
📝 locales/README.fa-IR.md (+1 -0)
📝 locales/README.ja-JP.md (+1 -0)
📝 locales/README.tr-TR.md (+1 -0)
📝 locales/README.zh-CN.md (+1 -0)
📝 server/.env.example (+4 -0)
📝 server/endpoints/utils.js (+3 -0)
📝 server/models/systemSettings.js (+4 -0)
server/utils/AiProviders/cerebras/index.js (+314 -0)
📝 server/utils/AiProviders/modelMap/index.js (+1 -0)
📝 server/utils/AiProviders/modelMap/legacy.js (+7 -0)
📝 server/utils/agents/aibitat/index.js (+2 -0)
📝 server/utils/agents/aibitat/providers/ai-provider.js (+16 -8)

...and 9 more files

📄 Description

Pull Request Type

  • feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #5605

Description

Adds Cerebras as a first-class LLM provider for chat
and agents. Cerebras serves an OpenAI-compatible inference API, so the
integration follows the existing fast-inference providers (Groq / SambaNova).

What's included:

  • CerebrasLLM chat provider — streaming, prompt-window limits sourced from
    the shared model map, and dynamic model discovery via GET /v1/models (the
    customModels helper).
  • CerebrasProvider agent provider — the standard UnTooled fallback plus
    optional native OpenAI-compatible tool calling, gated behind the existing
    PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING env (tool-calling support varies per
    Cerebras model, matching how Groq is handled).
  • Server wiringgetLLMProvider / getLLMProviderClass /
    getBaseLLMProviderModel, agent-provider selection + API-key checks, ENV
    validation & persistence, system settings, and the agent sub-task client
    builder (so agent helpers such as web-scraping summarization work for
    Cerebras).
  • Context windows — registers cerebras as a tracked LiteLLM provider in
    the model map and adds legacy fallback values for accurate limits.
  • Frontend — API key + model-selection options component, onboarding &
    settings provider entries, agent-provider enablement, privacy-policy entry,
    and the provider logo.
  • Docs / config — documents CEREBRAS_API_KEY / CEREBRAS_MODEL_PREF in
    the example env files and adds Cerebras to the supported-provider lists
    (README + locale READMEs).

Visuals (if applicable)

The provider UI mirrors the other OpenAI-compatible providers (e.g. Groq): an
API key field plus a model dropdown populated from the account's available
models, with the Cerebras logo in the provider list.

Additional Information

  • Default model: llama3.1-8b.
  • The chat provider, agent provider, model map, and customModels integration
    mirror the existing Groq / SambaNova implementations.
  • Validation: yarn lint (eslint + prettier) passes for all changed server and
    frontend files, and the provider was verified to be wired through every
    integration point at parity with the existing providers. End-to-end testing
    against the live Cerebras API requires an account API key.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5699 **Author:** [@officialasishkumar](https://github.com/officialasishkumar) **Created:** 5/24/2026 **Status:** ✅ Merged **Merged:** 5/27/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `feat/cerebras-llm-provider` --- ### 📝 Commits (7) - [`97d83ad`](https://github.com/Mintplex-Labs/anything-llm/commit/97d83ad819714cef77d85a29b8fe3c54ddc3f66d) feat: add Cerebras as an LLM provider - [`ddab3a9`](https://github.com/Mintplex-Labs/anything-llm/commit/ddab3a9b660f4b6132fbe641d9df4cb78c405af1) use proper model fallback - [`7fad9e9`](https://github.com/Mintplex-Labs/anything-llm/commit/7fad9e97cd032e90f52cdbadd2b1294374bf915c) context window reporting + better chat repsonses + show thinking - [`466420a`](https://github.com/Mintplex-Labs/anything-llm/commit/466420a67b5a06925f09b51d0e0c1ac685a5b34b) add Cerebrase agent tool calling, capability detection, context windows, and usage reporting - [`151a5bc`](https://github.com/Mintplex-Labs/anything-llm/commit/151a5bc1f63d3c7fe3228dd6ac2426611af8b4e9) add safety caching - [`721dc83`](https://github.com/Mintplex-Labs/anything-llm/commit/721dc83349581d723c1489a89129314ddaba7032) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into feat/cerebras-llm-provider - [`32588af`](https://github.com/Mintplex-Labs/anything-llm/commit/32588af365761bee99dded3e360be282eee6b594) stub out images ### 📊 Changes **29 files changed** (+779 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -0) 📝 `docker/.env.example` (+4 -0) ➕ `frontend/src/components/LLMSelection/CerebrasLLMOptions/index.jsx` (+109 -0) 📝 `frontend/src/components/ProviderPrivacy/constants.js` (+6 -0) ➕ `frontend/src/media/llmprovider/cerebras.png` (+0 -0) 📝 `frontend/src/pages/GeneralSettings/LLMPreference/index.jsx` (+10 -0) 📝 `frontend/src/pages/OnboardingFlow/Steps/LLMPreference/index.jsx` (+9 -0) 📝 `frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx` (+1 -0) 📝 `locales/README.fa-IR.md` (+1 -0) 📝 `locales/README.ja-JP.md` (+1 -0) 📝 `locales/README.tr-TR.md` (+1 -0) 📝 `locales/README.zh-CN.md` (+1 -0) 📝 `server/.env.example` (+4 -0) 📝 `server/endpoints/utils.js` (+3 -0) 📝 `server/models/systemSettings.js` (+4 -0) ➕ `server/utils/AiProviders/cerebras/index.js` (+314 -0) 📝 `server/utils/AiProviders/modelMap/index.js` (+1 -0) 📝 `server/utils/AiProviders/modelMap/legacy.js` (+7 -0) 📝 `server/utils/agents/aibitat/index.js` (+2 -0) 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+16 -8) _...and 9 more files_ </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat (New feature) - [ ] 🐛 fix (Bug fix) - [ ] ♻️ refactor (Code refactoring without changing behavior) - [ ] 💄 style (UI style changes) - [ ] 🔨 chore (Build, CI, maintenance) - [ ] 📝 docs (Documentation updates) ### Relevant Issues resolves #5605 ### Description Adds [Cerebras](https://www.cerebras.ai) as a first-class LLM provider for chat and agents. Cerebras serves an OpenAI-compatible inference API, so the integration follows the existing fast-inference providers (Groq / SambaNova). What's included: - **`CerebrasLLM` chat provider** — streaming, prompt-window limits sourced from the shared model map, and dynamic model discovery via `GET /v1/models` (the `customModels` helper). - **`CerebrasProvider` agent provider** — the standard `UnTooled` fallback plus optional native OpenAI-compatible tool calling, gated behind the existing `PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING` env (tool-calling support varies per Cerebras model, matching how Groq is handled). - **Server wiring** — `getLLMProvider` / `getLLMProviderClass` / `getBaseLLMProviderModel`, agent-provider selection + API-key checks, ENV validation & persistence, system settings, and the agent sub-task client builder (so agent helpers such as web-scraping summarization work for Cerebras). - **Context windows** — registers `cerebras` as a tracked LiteLLM provider in the model map and adds legacy fallback values for accurate limits. - **Frontend** — API key + model-selection options component, onboarding & settings provider entries, agent-provider enablement, privacy-policy entry, and the provider logo. - **Docs / config** — documents `CEREBRAS_API_KEY` / `CEREBRAS_MODEL_PREF` in the example env files and adds Cerebras to the supported-provider lists (README + locale READMEs). ### Visuals (if applicable) The provider UI mirrors the other OpenAI-compatible providers (e.g. Groq): an API key field plus a model dropdown populated from the account's available models, with the Cerebras logo in the provider list. ### Additional Information - Default model: `llama3.1-8b`. - The chat provider, agent provider, model map, and `customModels` integration mirror the existing Groq / SambaNova implementations. - Validation: `yarn lint` (eslint + prettier) passes for all changed server and frontend files, and the provider was verified to be wired through every integration point at parity with the existing providers. End-to-end testing against the live Cerebras API requires an account API key. ### Developer Validations - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated (if applicable) - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 15:21:40 -04:00
yindo closed this issue 2026-06-05 15:21:40 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5537