FlowiseAI/Flowise · error · Error
There must be a LLM model connected to LLM Filter Retriever
Error message
There must be a LLM model connected to LLM Filter Retriever
What it means
Thrown by LLMFilterCompressionRetriever.init when nodeData.inputs.model is falsy. LLMChainExtractor.fromLLM requires a language model to decide which documents to keep; with no model wired the node cannot build the compressor and aborts.
Source
Thrown at packages/components/nodes/retrievers/LLMFilterRetriever/LLMFilterCompressionRetriever.ts:78
description: 'Array of document objects containing metadata and pageContent',
baseClasses: ['Document', 'json']
},
{
label: 'Text',
name: 'text',
description: 'Concatenated string from pageContent of documents',
baseClasses: ['string', 'json']
}
]
}
async init(nodeData: INodeData, input: string): Promise<any> {
const baseRetriever = nodeData.inputs?.baseRetriever as BaseRetriever
const model = nodeData.inputs?.model as BaseLanguageModel
const query = nodeData.inputs?.query as string
const output = nodeData.outputs?.output as string
if (!model) throw new Error('There must be a LLM model connected to LLM Filter Retriever')
const retriever = new ContextualCompressionRetriever({
baseCompressor: LLMChainExtractor.fromLLM(model),
baseRetriever: baseRetriever
})
if (output === 'retriever') return retriever
else if (output === 'document') return await retriever._getRelevantDocuments(query ? query : input)
else if (output === 'text') {
let finaltext = ''
const docs = await retriever._getRelevantDocuments(query ? query : input)
for (const doc of docs) finaltext += `${doc.pageContent}\n`
return handleEscapeCharacters(finaltext, false)
}
View on GitHub (pinned to abe4a8601a)
Solutions
- Connect a Chat LLM or LLM node to the LLM Filter Retriever's model input.
- Confirm the connected model node initializes successfully on its own.
- Ensure the model output type is BaseLanguageModel (not Embeddings).
Example fix
// before: model input unconnected // after: wire a ChatOpenAI / ChatAnthropic (etc.) node into the model input
Defensive patterns
Strategy: type-guard
Validate before calling
import { BaseLanguageModel } from '@langchain/core/language_models/base'
function ensureModel(model: unknown): BaseLanguageModel {
if (!model) throw new Error('Connect an LLM to the LLM Filter Retriever model input.')
if (typeof (model as any)._generate !== 'function' && typeof (model as any).invoke !== 'function') {
throw new Error('Connected node is not a BaseLanguageModel.')
}
return model as BaseLanguageModel
} Type guard
function isBaseLanguageModel(m: unknown): m is BaseLanguageModel {
return !!m && typeof m === 'object' && ('_generate' in m || 'invoke' in m) && '_modelType' in (m as any)
} Try / catch
try {
await retriever.init(nodeData, input)
} catch (e) {
if (e instanceof Error && /LLM model connected/.test(e.message)) {
// highlight the model input port
}
throw e
} Prevention
- Validate the chatflow graph: every LLM Filter Retriever has an incoming model edge.
- Use a type guard on nodeData.inputs.model before init.
- Test that the connected model node initializes in isolation.
When it happens
Trigger: LLM Filter Retriever node has no model input connected; the connected model node errored on init and produced undefined; the wrong input type is wired (e.g. an embedding model where a chat model is expected).
Common situations: Forgotten edge in the chatflow graph; model node deleted after wiring; mismatch between the expected BaseLanguageModel input and what is connected.
Related errors
- Azure Foundry API Key is missing in credentials.
- Azure Foundry Endpoint is missing in credentials.
- Must specify one of "k" or "similarity_threshold".
- Model is required
- ${e}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/333e1d870af6adbf.
Report an issue: GitHub.