Skip to content
BAAI logo

bge-large-en-v1.5

Text EmbeddingsBAAIHosted

BAAI general embedding (Large) model that transforms any given text into a 1024-dimensional vector

Model Info
More informationlink
Maximum Input Tokens512
Output Dimensions1,024
BatchYes
Unit Pricing$0.20 per M input tokens

Usage

export interface Env {
AI: Ai;
}
export default {
async fetch(request, env): Promise<Response> {
// Can be a string or array of strings]
const stories = [
"This is a story about an orange cloud",
"This is a story about a llama",
"This is a story about a hugging emoji",
];
const embeddings = await env.AI.run(
"@cf/baai/bge-large-en-v1.5",
{
text: stories,
}
);
return Response.json(embeddings);
},
} satisfies ExportedHandler<Env>;

Parameters

Synchronous — Send a request and receive a complete response
pooling
stringdefault: meanenum: mean, clsThe pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy.
Batch — Send multiple requests in a single API call

API Schemas (Raw)

Synchronous Input
Synchronous Output
Batch Input
Batch Output