You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cbac4a4
Browse filesBrowse the repository at this point in the historyBrowse files
fix(embeddings): validate width per model and stop guessing an Ollama target
Third round of review findings:
- Require an explicit OLLAMA_URL before resolving a model's width, matching what
the embedding client already demands, so a loopback server cannot produce a
knowledge base every later call refuses to serve
- Validate EMBEDDING_OUTPUT_DIMS against the selected model rather than its
family, since the family pattern accepted widths the model silently overrides
- Raise a validation error for a missing model or unreportable width, so the
route renders 400 instead of a generic 500
- Stop the Embeddings block auto-persisting whichever model Ollama lists first
- Do not offer back a configured value that the provider being set up rejects,
so switching families cannot carry the previous family's model forward
- Cancel the response body of a rejected Ollama probe
- Make the drop-on-inspection-failure test actually exercise that path
- Correct the setup provider list, the older-Ollama filtering caveat, and the
Sim Cloud OLLAMA_URL claim in the docs
Copy file name to clipboardExpand all lines: apps/docs/content/docs/integrations/embeddings.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Models differ in what they are good at and what they cost. `text-embedding-3-sma
19
19
20
20
Two things worth knowing before you build on it. Vectors are only comparable when they come from the same model at the same size, so changing either means re-embedding everything you intend to compare. And input longer than the model's limit is shortened to fit rather than rejected, with a warning in the run, so chunk long documents yourself when the tail matters.
21
21
22
-
Ollama is the exception to most of the above. It runs on your own deployment, so it needs no API key and adds no provider charge — Sim's own per-run charge still applies — and the model list is whatever you have pulled onto that server rather than a catalog Sim maintains. The block reads it live, drops the models that report a non-embedding capability, and shows each one's vector width next to its name where Ollama reports one. A server too old to report either will list its chat models too and label none of them, so check the model you pick. The block offers no task-type or dimension control for Ollama: task conditioning has no equivalent there, and while recent Ollama builds do accept a dimension override for Matryoshka models, older ones silently ignore it, so Sim uses each model's own width rather than one that may or may not take effect. Self-hosted deployments configure the server with `OLLAMA_URL`; on Sim Cloud there is no Ollama to reach, so the list comes back empty.
22
+
Ollama is the exception to most of the above. It runs on your own deployment, so it needs no API key and adds no provider charge — Sim's own per-run charge still applies — and the model list is whatever you have pulled onto that server rather than a catalog Sim maintains. The block reads it live, drops the models that report a non-embedding capability, and shows each one's vector width next to its name where Ollama reports one. A server too old to report either will list its chat models too and label none of them, so check the model you pick. The block offers no task-type or dimension control for Ollama: task conditioning has no equivalent there, and while recent Ollama builds do accept a dimension override for Matryoshka models, older ones silently ignore it, so Sim uses each model's own width rather than one that may or may not take effect. Point Sim at the server with `OLLAMA_URL`. Sim Cloud runs no Ollama of its own, so without that variable the list comes back empty rather than dialling a loopback address that cannot answer — set it to a reachable server and Cloud will use it like any other deployment.
23
23
24
24
Sim's knowledge bases embed separately: a base fixes one model and one vector width when it is created, from a smaller set of models. This block is for embedding text yourself inside a workflow.
`Could not read the vector width of ${model} from the configured Ollama server (${getErrorMessage(error,'Unknown error')}). Set EMBEDDING_OUTPUT_DIMS to the width it emits.`
127
-
)
130
+
/**
131
+
* A model the server does not have, or one whose width it will not report,
132
+
* is the operator's to fix and is surfaced as such. An unreachable server
133
+
* is a dependency failure and keeps its default classification — the
134
+
* orchestration vocabulary has no upstream-failure code, and the message
135
+
* carries the cause either way.
136
+
*/
137
+
constmessage=`Could not read the vector width of ${model} from the configured Ollama server (${getErrorMessage(error,'Unknown error')}). Set EMBEDDING_OUTPUT_DIMS to the width it emits.`
`${model} emits ${dimensions}-dimensional vectors, which knowledge bases cannot store. Choose a model emitting one of ${KB_EMBEDDING_STORAGE_DIMENSIONS.join(', ')}.`
0 commit comments