Registry / llm-agents / llama-index-embeddings-cohere

llama-index-embeddings-cohere

JSON →
library0.8.0pypypi✓ verified 84d ago

LlamaIndex integration for Cohere embedding models. Current version 0.8.0, requires Python >=3.10 and <4.0. Released as part of the llama-index plugin ecosystem; version bumps may follow llama-index core releases.

pip install llama-index-embeddings-cohere
INSTALL
IMPORT
SIG · LLAMA-INDEX-EMBEDD
L
llama-index-embeddings-cohere
llm-agentspythonv0.8.0
Install
21.7s avg
Import
6800ms
Disk
313MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 5.678s · 309.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 21.7s · import 5.202s · 290MB
313MB installed
● package 313MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CohereEmbedding
from llama_index.embeddings.cohere import CohereEmbedding
Correct import path as of version 0.8.0
CohereEmbedding
from llama_index.embeddings.cohere import CohereEmbedding
from llama_index import CohereEmbedding
Direct import from llama_index package not supported; must use submodule path

Initialize Cohere embedding model, get a sample embedding.

import os from llama_index.embeddings.cohere import CohereEmbedding embed_model = CohereEmbedding( api_key=os.environ.get("COHERE_API_KEY", ""), model_name="embed-english-v3.0", input_type="search_query", ) print(embed_model.get_text_embedding("Hello world!")[:5])
Debug
Known issues
breakingVersion 0.8.0 changed import path from `llama_index.embeddings.cohere` (previously may have been `llama_index.embeddings.cohere.base`). Ensure correct import.
fix
Use `from llama_index.embeddings.cohere import CohereEmbedding`.
affects: >=0.8.0
deprecatedThe `embed_batch_size` parameter was removed; batching is now handled automatically.
fix
Remove `embed_batch_size` when constructing CohereEmbedding.
affects: >=0.8.0
gotchaCohere requires `input_type` parameter (e.g., 'search_query', 'search_document', 'classification'). Omitting it may cause errors from the API.
fix
Always specify `input_type` when calling `get_text_embedding` or during initialization.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'CohereEmbedding' from 'llama_index'
Incorrect import path; trying to import directly from the top-level `llama_index` package.
fix
Use `from llama_index.embeddings.cohere import CohereEmbedding`.
cohere.core.api_error.ApiError: status_code: 400, body: {'message': 'input_type is required'}
Missing `input_type` parameter when using Cohere embedding models that require it (e.g., embed-english-v3.0).
fix
Pass `input_type` to the embedding call or during initialization.
TypeError: __init__() got an unexpected keyword argument 'embed_batch_size'
The `embed_batch_size` parameter was removed in newer versions of this library.
fix
Remove `embed_batch_size` from the constructor arguments.
Upgrade
Version history
0.8.0latest on PyPI · released Mar 12, 2026
Audit
Dependencies
llama-index-coreoptionalRequired for base abstractions and embedding interface
cohererequiredOfficial Cohere Python SDK to interact with Cohere API
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
llama-index-embeddings-cohere — pip install llama-index-embeddings-cohere · libregistry