Ollama Embeddings

Ollama Embeddings

Endpoint: /ollama/api/embeddings

Description: Generate embeddings for provided text using a specified model.

Authentication: Required (JWT token or Api Key)

HTTP Method: POST

Request Format:

{
	"model": "nomic-embed-text:latest",
	"prompt": "This is a sample text for embedding generation",
	"options": {
		"temperature": 0.5
	},
	"keep_alive": -1
}

Key Request Parameters:

Parameter
Type
Required
Description

model

string

Yes

ID of the model to use

prompt

string

Yes

Text to generate embeddings for

options

object

No

Model-specific options

keep_alive

number/string

No

Duration to keep model loaded in seconds

Response Format:

{
  "embedding": [0.012, -0.045, 0.067, ... ],
}

Key Response Fields:

Field
Type
Description

embedding

array of numbers

Vector representation of the input text

Response Codes:

  • 200: Successfully generated embeddings

  • 400: Model not found or invalid request

Last updated