Skip to content
Cloudflare Docs
p

plamo-embedding-1b

Text Embeddingspfnet
@cf/pfnet/plamo-embedding-1b

PLaMo-Embedding-1B is a Japanese text embedding model developed by Preferred Networks, Inc. It can convert Japanese text input into numerical vectors and can be used for a wide range of applications, including information retrieval, text classification, and clustering.

Model Info
Unit Pricing$0.019 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/pfnet/plamo-embedding-1b",
{
text: stories,
}
);
return Response.json(embeddings);
},
} satisfies ExportedHandler<Env>;

Parameters

* indicates a required field

Input

  • text one of required

    • 0 string

      Input text to embed. Can be a single string or a list of strings.

    • 1 array

      Input text to embed. Can be a single string or a list of strings.

      • items string

Output

  • data array required

    Embedding vectors, where each vector is a list of floats.

    • items array

      • items number

  • shape array required

    Shape of the embedding data as [number_of_embeddings, embedding_dimension].

    • items integer

API Schemas

The following schemas are based on JSON Schema

{
"type": "object",
"properties": {
"text": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Input text to embed. Can be a single string or a list of strings."
}
},
"required": [
"text"
]
}