Reference
Arcane.ollama.embed()
Creates embeddings after Core re-admits the exact requested model.
This focused page is derived from the mechanically checked full member inventory.
Syntax
Arcane.ollama.embed(request)
Parameters
request: OllamaEmbedRequest
Return value
Description
Creates embeddings after Core re-admits the exact requested model.
Overview
Arcane.ollama.embed(request) creates provider-native local embeddings after
Core re-admits the exact model and requested context. Use it only when an
application intentionally owns the Ollama embedding contract and the returned
vectors' storage/privacy lifecycle.
Parameters
request is a closed plain object of at most 8 MiB. Required model uses the
Ollama name pattern. Supported provider fields are input (text or a batch),
truncate, dimensions, keep_alive, and options; when present,
options.num_ctx is 1,024-262,144. Nested provider-native values are forwarded
for Ollama to validate.
Return value
It resolves to Ollama's bounded provider-native embed envelope, including the provider's vectors and metadata. Arcane does not normalize vector count or dimension into a separate stable entity.
Availability
This is a desktop Core method requiring ai.inference. Verified models can use
the managed ensure/repair path before admission. Unverified installed models
also require ai.models.unverified.inference. Applications with an isolated
model contract must use their application-owned API, and Android does not
project direct embed.
Errors and recovery
Correct invalid object, unknown field, model, serialization, request-size, or context errors before retrying. Model-policy, installation, isolation, and resource-admission errors require a currently admitted embedding model. Provider failures remain local-Ollama errors and never trigger remote fallback.
Streaming, cancellation, and events
The public wrapper does not accept stream controls, a chunk callback, or an
AbortSignal; it resolves one result and emits no method event. Its renderer
timeout is ten minutes. Although the Core RPC boundary can cancel an embed
request when a host control arrives, application code has no per-call signal in
this API.
Example
async function embedNonSensitiveText(verifiedEmbeddingModel, text) {
if (typeof text !== 'string' || text.length === 0) {
throw new TypeError('Embedding input must be nonempty text.');
}
return globalThis.Arcane.ollama.embed({
model: verifiedEmbeddingModel,
input: text
});
}