Mintplex-Labs/anything-llm · critical · Error
No FireworksAI API key was set.
Error message
No FireworksAI API key was set.
What it means
Constructor guard that prevents FireworksAiLLM instantiation when FIREWORKS_AI_LLM_API_KEY is missing. The key authenticates the OpenAI-compatible client at https://api.fireworks.ai/inference/v1. Without it the client cannot make inference calls, so the class aborts at construction.
Source
Thrown at server/utils/AiProviders/fireworksAi/index.js:23
const {
LLMPerformanceMonitor,
} = require("../../helpers/chat/LLMPerformanceMonitor");
const {
handleDefaultStreamResponseV2,
} = require("../../helpers/chat/responses");
const cacheFolder = path.resolve(
process.env.STORAGE_DIR
? path.resolve(process.env.STORAGE_DIR, "models", "fireworks")
: path.resolve(__dirname, `../../../storage/models/fireworks`)
);
class FireworksAiLLM {
constructor(embedder = null, modelPreference = null) {
this.className = "FireworksAiLLM";
if (!process.env.FIREWORKS_AI_LLM_API_KEY)
throw new Error("No FireworksAI API key was set.");
const { OpenAI: OpenAIApi } = require("openai");
this.openai = new OpenAIApi({
baseURL: "https://api.fireworks.ai/inference/v1",
apiKey: process.env.FIREWORKS_AI_LLM_API_KEY ?? null,
});
this.model = modelPreference || process.env.FIREWORKS_AI_LLM_MODEL_PREF;
this.limits = {
history: this.promptWindowLimit() * 0.15,
system: this.promptWindowLimit() * 0.15,
user: this.promptWindowLimit() * 0.7,
};
this.embedder = !embedder ? new NativeEmbedder() : embedder;
this.defaultTemp = 0.7;
if (!fs.existsSync(cacheFolder))
fs.mkdirSync(cacheFolder, { recursive: true });
this.cacheModelPath = path.resolve(cacheFolder, "models.json");View on GitHub (pinned to 526360e320)
Solutions
- Set FIREWORKS_AI_LLM_API_KEY in .env to a valid key from fireworks.ai/account/api-keys.
- Restart the server to load the new env var.
- Re-enter the key in the AnythingLLM FireworksAI provider settings and save.
Example fix
# .env FIREWORKS_AI_LLM_API_KEY=fw-your-fireworks-key-here
Defensive patterns
Strategy: validation
Validate before calling
const FW_KEY = process.env.FIREWORKS_AI_LLM_API_KEY;
if (!FW_KEY || FW_KEY.trim() === '')
throw new Error('FIREWORKS_AI_LLM_API_KEY must be set before using the FireworksAI provider'); Try / catch
try {
provider = new FireworksAiLLM(embedder, modelPref);
} catch (e) {
if (/No FireworksAI API key/i.test(e.message))
return respondConfigError('Set FIREWORKS_AI_LLM_API_KEY in the FireworksAI provider settings.');
throw e;
} Prevention
- Store the key in .env and verify dotenv loads it on startup.
- Run a provider env-var health check on boot.
- Re-enter the key in the UI after any rotation.
When it happens
Trigger: Instantiating `new FireworksAiLLM()` with FIREWORKS_AI_LLM_API_KEY unset or empty; selecting FireworksAI as the provider without saving a key; env var name typo.
Common situations: Fresh deployment selecting FireworksAI without entering a key; .env missing the key after migration; key revoked on the Fireworks AI dashboard; CI environment without the key injected.
Related errors
- No CometAPI API key was set.
- No DeepSeek API key was set.
- No Docker Model Runner API Base Path was set.
- No Docker Model Runner Model Pref was set.
- FireworksAI chat: ${this.model} is not valid for chat comple
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/ff039c7a675ce518.
Report an issue: GitHub.