Overview
Edgee’s OpenAI-compatible API works seamlessly with LangChain, allowing you to leverage LangChain’s powerful features like chains, agents, memory, and RAG while maintaining control over your LLM infrastructure.Installation
Usinguv with inline dependencies (PEP 723):
Basic Usage
Command-Line Script
Complete script with argument parsing:Usage Examples
Advanced Features
Chains
Streaming Responses
Authentication
Edgee uses standard Bearer token authentication. Set your API key as an environment variable:api_key parameter in ChatOpenAI automatically formats the header as:
Benefits of Using LangChain with Edgee
Unified Infrastructure
Access all LLM providers through Edgee while using LangChain’s developer-friendly interface.
Cost Control
Leverage Edgee’s cost tracking and routing while building complex LangChain applications.
Reliability
Combine LangChain’s agent capabilities with Edgee’s automatic failover and load balancing.
Observability
Monitor your LangChain applications with Edgee’s built-in observability features.
Next Steps
- Explore LangChain’s documentation for advanced features
- Check out Edgee’s routing capabilities for intelligent model selection
- Set up observability to monitor your LangChain applications