Skip to content

v2.23.0: Cohere provider (LLM, Embedding, Reranker)

Choose a tag to compare

@lfnovo lfnovo released this 16 Jun 15:46
2ceae1b

Added

Cohere provider (LLM, Embedding, Reranker) — #110

Cohere is now a first-class provider across three capabilities, integrated via its native v2 API (/v2/chat, /v2/embed, /v2/rerank) rather than an OpenAI-compatible profile — its differentiators (documents-based RAG, citations, input_type embeddings, native tool format) aren't exposed on the compatibility endpoint. Pure HTTP via httpx, auth shared via COHERE_API_KEY.

  • LLMAIFactory.create_language("cohere", "command-a-03-2025"): chat, streaming, and tool calling. Esperanto's top_p maps to Cohere's p. Cohere-specific RAG fields (documents, citation_options, connectors) pass through via config without changing the universal chat_complete surface; returned citations are not surfaced on ChatCompletion in this version (out of scope).
  • EmbeddingAIFactory.create_embedding("cohere", "embed-v4.0"): input_type-aware (default search_document, configurable per-call), with automatic batching to Cohere's 96-texts-per-request limit.
  • RerankerAIFactory.create_reranker("cohere", "rerank-v4.0-pro"): maps top_k to Cohere's top_n, returns a normalized RerankResponse.
  • Model discoveryAIFactory.get_provider_models("cohere") lists chat, embed, and rerank models live via /v1/models (paginated), tagged by Esperanto type.

All three capabilities ship with mocked-API unit tests and documentation in docs/providers/cohere.md.

Full Changelog: v2.22.0...v2.23.0