langchain-multi-env-setup
Installation
SKILL.md
LangChain Multi-Environment Setup
Overview
Configure LangChain across development, staging, and production with separate API keys, environment-specific model settings, LangSmith project isolation, and validated configuration.
Environment Strategy
| Environment | API Key Source | Model | LangSmith Project | Cache |
|---|---|---|---|---|
| Development | .env.local |
gpt-4o-mini | dev-{user} |
Off |
| Staging | CI secrets | gpt-4o-mini | staging |
Redis |
| Production | Secret Manager | gpt-4o | production |
Redis |
Step 1: Configuration with Zod Validation
// config/langchain.ts
import { z } from "zod";
import "dotenv/config";