Cohere Production Checklist
Overview
Complete go-live checklist for deploying Cohere API v2 integrations to production with safety gates, health checks, and rollback procedures.
Prerequisites
- Staging environment tested and verified
- Production API key (not trial) from dashboard.cohere.com
- Deployment pipeline configured
- Monitoring and alerting ready
Checklist
API & Authentication
Code Quality
Model Selection
| Use Case | Recommended Model | Fallback |
|---|
| Chat/generation | command-a-03-2025 | command-r-plus-08-2024 |
| Lightweight chat | command-r7b-12-2024 | command-r-08-2024 |
| Embeddings | embed-v4.0 | embed-english-v3.0 |
| Reranking | rerank-v3.5 | rerank-english-v3.0 |
Performance
Health Check Endpoint
import { CohereClientV2, CohereError } from 'cohere-ai';
const cohere = new CohereClientV2();
export async function GET() {
const start = Date.now();
let cohereStatus: 'healthy' | 'degraded' | 'down' = 'down';
try {
await cohere.chat({
model: 'command-r7b-12-2024',
messages: [{ role: 'user', content: 'ping' }],
maxTokens: 1,
});
cohereStatus = 'healthy';
} catch (err) {
if (err instanceof CohereError && err.statusCode === 429) {
cohereStatus = 'degraded';
}
}
return Response.json({
status: cohereStatus === 'healthy' ? 'ok' : ,
: {
: cohereStatus,
: .() - start,
},
: ().(),
});
}
Circuit Breaker
class CohereCircuitBreaker {
private failures = 0;
private lastFailure = 0;
private state: 'closed' | 'open' | 'half-open' = 'closed';
constructor(
private threshold = 5,
private resetMs = 60_000
) {}
async call<T>(fn: () => Promise<T>, fallback?: () => T): Promise<T> {
if (this.state === 'open') {
if (Date.now() - this.lastFailure > this.resetMs) {
this.state = 'half-open';
} else if (fallback) {
return fallback();
} else {
throw new Error('Cohere circuit breaker is open');
}
}
try {
const result = await fn();
. = ;
. = ;
result;
} (err) {
.++;
. = .();
(. >= .) {
. = ;
.();
}
err;
}
}
}
breaker = ();
Gradual Rollout
curl -sf https://staging.example.com/api/health | jq '.cohere'
curl -s https://status.cohere.com/api/v2/status.json | jq '.status'
kubectl apply -f k8s/production.yaml
kubectl rollout pause deployment/app
kubectl rollout resume deployment/app
kubectl rollout status deployment/app
Monitoring Alerts
| Alert | Condition | Severity |
|---|
| Cohere unreachable | Health check fails 3x | P1 |
| High error rate | 5xx > 5% of requests/5min | P1 |
| Rate limited | 429 > 10/min | P2 |
| High latency | Chat P95 > 10s | P2 |
| Auth failure | Any 401 response | P1 |
| Budget exceeded | Daily token cost > threshold | P2 |
Rollback
kubectl rollout undo deployment/app
kubectl rollout status deployment/app
curl -sf https://api.example.com/api/health | jq '.cohere'
Output
- Production-ready Cohere integration with health checks
- Circuit breaker preventing cascade failures
- Monitoring alerts for Cohere-specific error conditions
- Documented rollback procedure
Resources
Next Steps
For version upgrades, see cohere-upgrade-migration.