| name | cohere-multi-env-setup |
| description | Configure Cohere across development, staging, and production environments.
Use when setting up multi-environment deployments, configuring per-environment
API keys, model selection, and rate limit strategies.
Trigger with phrases like "cohere environments", "cohere staging",
"cohere dev prod", "cohere environment setup", "cohere config by env".
|
| allowed-tools | Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*) |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","nlp","cohere"] |
| compatibility | Designed for Claude Code |
Cohere Multi-Environment Setup
Overview
Configure Cohere API v2 across dev/staging/prod with environment-specific API keys, model selection, and budget controls.
Prerequisites
- Separate Cohere API keys per environment (trial for dev, production for staging/prod)
- Secret management solution (Vault, AWS Secrets Manager, GCP Secret Manager)
- Environment detection in application
Environment Strategy
| Environment | API Key Type | Model | maxTokens | Caching |
|---|
| Development | Trial (free) | command-r7b-12-2024 | 200 | Disabled |
| Staging | Production | command-r-08-2024 | 1000 | Enabled |
| Production | Production | command-a-03-2025 | 4096 | Enabled |
Instructions
Step 1: Configuration Structure
type Environment = 'development' | 'staging' | 'production';
interface CohereEnvConfig {
chatModel: string;
embedModel: string;
rerankModel: string;
maxTokens: number;
cacheEnabled: boolean;
cacheTtlMs: number;
retries: number;
timeoutSeconds: number;
}
const configs: Record<Environment, > = {
: {
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
},
: {
: ,
: ,
: ,
: ,
: ,
: * * ,
: ,
: ,
},
: {
: ,
: ,
: ,
: ,
: ,
: * * ,
: ,
: ,
},
};
(): {
env = process.. ?? ;
([, , ].(env)) {
env ;
}
;
}
(): & { : } {
env = ();
{ ...configs[env], : env };
}