Skip to main content
POST
/
api
/
embed
curl http://localhost:11434/api/embed -d '{
 "model": "embeddinggemma",
 "input": "Why is the sky blue?"
}'
{
 "model": "embeddinggemma",
 "embeddings": [
 [
 0.010071029,
 -0.0017594862,
 0.05007221,
 0.04692972,
 0.054916814,
 0.008599704,
 0.105441414,
 -0.025878139,
 0.12958129,
 0.031952348
 ]
 ],
 "total_duration": 14143917,
 "load_duration": 1019500,
 "prompt_eval_count": 8
}

Body

application/json
model
string
required

Model name

input
required

Text or array of texts to generate embeddings for

truncate
boolean
default:true

If true, truncate inputs that exceed the context window. If false, returns an error.

dimensions
integer

Number of dimensions to generate embeddings for

keep_alive
string

Model keep-alive duration

options
object

Runtime options that control text generation

Response

200 - application/json

Vector embeddings for the input text

model
string

Model that produced the embeddings

embeddings
number[][]

Array of vector embeddings

total_duration
integer

Total time spent generating in nanoseconds

load_duration
integer

Load time in nanoseconds

prompt_eval_count
integer

Number of input tokens processed to generate embeddings

curl http://localhost:11434/api/embed -d '{
 "model": "embeddinggemma",
 "input": "Why is the sky blue?"
}'
{
 "model": "embeddinggemma",
 "embeddings": [
 [
 0.010071029,
 -0.0017594862,
 0.05007221,
 0.04692972,
 0.054916814,
 0.008599704,
 0.105441414,
 -0.025878139,
 0.12958129,
 0.031952348
 ]
 ],
 "total_duration": 14143917,
 "load_duration": 1019500,
 "prompt_eval_count": 8
}

AltStyle によって変換されたページ (->オリジナル) /