WebInfer

🔮

Cohere

Command R+ models with RAG support

Flagship
Major Cloud Provider
API

Configure Cohere

Add your Cohere API key in Settings

Go to Settings
Capabilities
chat
embeddings
rerank
rag
Configuration Schema
Required and optional fields for configuring this provider
FieldTypeRequired
apiKey
password
Required
CLI Usage
For users running the daemon server locally or a self-hosted gateway

Add provider:

npx webinfer provider add cohere --key YOUR_API_KEY

Test connection:

npx webinfer provider test cohere

Get your API key from https://dashboard.cohere.com/

Programmatic Usage
Use Cohere in your code with WebInfer

Basic usage:

import { generateText } from "webinfer"

// WebInfer automatically routes to the best available provider
const result = await generateText({
  prompt: "Write a haiku about programming"
})

console.log(result.text)

Specify Cohere explicitly:

import { generateText } from "webinfer"

const result = await generateText({
  prompt: "Write a haiku about programming",
  provider: "cohere"
})

console.log(result.text)
console.log("Provider:", result.provider)
console.log("Model:", result.model)

Streaming:

import { streamText } from "webinfer"

const { textStream } = await streamText({
  prompt: "Write a story about AI",
  provider: "cohere"
})

for await (const chunk of textStream) {
  process.stdout.write(chunk)
}
Embedding Models
Default: embed-english-v3.0
embed-english-v3.0Best for English text
1024D
embed-multilingual-v3.0Best for multilingual text
1024D
embed-english-light-v3.0Lightweight English model
384D
embed-multilingual-light-v3.0Lightweight multilingual model
384D