mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-10-17 05:14:19 +02:00
_embedWithFallback() always tried Ollama's native /api/embed first and only reached /v1/embeddings from the catch block. Against a backend that only speaks the OpenAI embeddings API, every batch therefore paid a guaranteed-failing round trip plus a warn line before doing the real work. Invisible on a handful of documents. Expensive on a bulk file-embeddings job: the reporter is indexing several million chunks through an OpenAI-compatible proxy, which doubles request volume and log noise against their embedding host for the entire lifetime of the ingest. Gates the native attempt on _isNativeBackend(), matching how _doDownloadModel already skips /api/pull. Used the probe rather than reading isOllamaNative directly: the field is null until something populates it, and an embed job can easily be the first thing to touch the service after a restart, which is exactly when a long ingest is starting and the saving matters most. The probe memoizes for the process lifetime, so this costs one request overall rather than one per batch. Behaviour is otherwise unchanged. A native backend still tries /api/embed first and still falls back if it fails for a non-context reason, and context-length errors still bubble to embed() for the truncated retry. The response-shape validation stays: the probe establishes that /api/tags answered like Ollama, not that /api/embed will. Reported by @horsleyb. Closes #1279 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| bin | ||
| commands | ||
| config | ||
| constants | ||
| database | ||
| docs | ||
| inertia | ||
| providers | ||
| public | ||
| resources | ||
| scripts | ||
| start | ||
| tests | ||
| types | ||
| util | ||
| views | ||
| .editorconfig | ||
| .env.example | ||
| ace.js | ||
| adonisrc.ts | ||
| eslint.config.js | ||
| package-lock.json | ||
| package.json | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vite.config.ts | ||