LangDB
LangDB is an AI Gateway for seamless access to 350+ LLMs. Secure, govern, and optimize AI Traffic across LLMs using OpenAI-Compatible APIs.
For detailed integration instructions, see the LangDB Kern documentation.
Authentication
Set your LANGDB_API_KEY environment variable. Get your key from here.
1export LANGDB_API_KEY=***2export LANGDB_PROJECT_ID=***1setx LANGDB_API_KEY ***2setx LANGDB_PROJECT_ID ***Example
Use LangDB with your Agent:
1from kern.agent import Agent2from kern.models.langdb import LangDB34agent = Agent(5 model=LangDB(id="gpt-5-mini"),6 markdown=True7)89# Print the response in the terminal10agent.print_response("Share a 2 sentence horror story.")Params
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "gpt-4o-mini" | The id of the model to use through LangDB |
name | str | "LangDB" | The name of the model |
provider | str | "LangDB" | The provider of the model |
api_key | Optional[str] | None | The API key for LangDB (defaults to LANGDB_API_KEY env var) |
base_url | str | "https://api.langdb.ai/v1" | The base URL for the LangDB API |
LangDB also supports the params of OpenAI.