File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
apps/sim/app/api/knowledge Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,14 @@ export async function POST(req: NextRequest) {
168168
169169 // Auto-correct dimension if the model reports a different one
170170 if ( modelInfo . embeddingLength && modelInfo . embeddingLength !== effectiveDimension ) {
171+ if ( modelInfo . embeddingLength < 64 || modelInfo . embeddingLength > 8192 ) {
172+ return NextResponse . json (
173+ {
174+ error : `Ollama model "${ modelName } " reported an unsupported embedding dimension (${ modelInfo . embeddingLength } ). Supported range: 64–8192.` ,
175+ } ,
176+ { status : 400 }
177+ )
178+ }
171179 logger . info (
172180 `[${ requestId } ] Auto-correcting embedding dimension from ${ effectiveDimension } ` +
173181 `to ${ modelInfo . embeddingLength } (reported by Ollama model ${ modelName } )`
You can’t perform that action at this time.
0 commit comments