Skip to main content

Overview

Cohere provides high-quality embedding models optimized for search, classification, and clustering with excellent multilingual support.

Quick Start

from praisonaiagents import embedding

result = embedding(
    input="Hello world",
    model="cohere/embed-english-v3.0"
)
print(f"Dimensions: {len(result.embeddings[0])}")

CLI Usage

praisonai embed "Hello world" --model cohere/embed-english-v3.0

Setup

export COHERE_API_KEY="your-cohere-api-key"

Available Models

ModelDimensionsLanguagesUse Case
cohere/embed-v4.01024100+Latest, best quality
cohere/embed-english-v3.01024EnglishHigh quality English
cohere/embed-english-light-v3.0384EnglishFast, cost-effective
cohere/embed-multilingual-v3.01024100+Multilingual support

Input Types

Cohere supports different input types for optimal embeddings:
from praisonaiagents import embedding

# For search queries
result = embedding(
    input="What is machine learning?",
    model="cohere/embed-english-v3.0",
    input_type="search_query"
)

# For documents to be searched
result = embedding(
    input="Machine learning is a subset of AI...",
    model="cohere/embed-english-v3.0",
    input_type="search_document"
)

Batch Embeddings

from praisonaiagents import embedding

documents = [
    "First document content",
    "Second document content",
    "Third document content"
]
result = embedding(
    input=documents,
    model="cohere/embed-english-v3.0"
)
print(f"Generated {len(result.embeddings)} embeddings")

Multilingual Example

from praisonaiagents import embedding

texts = [
    "Hello world",           # English
    "Bonjour le monde",      # French
    "Hola mundo",            # Spanish
    "こんにちは世界"          # Japanese
]
result = embedding(
    input=texts,
    model="cohere/embed-multilingual-v3.0"
)

Pricing

ModelPrice per 1M tokens
embed-v4.0$0.10
embed-english-v3.0$0.10
embed-english-light-v3.0$0.10
embed-multilingual-v3.0$0.10