[ Akshay Dongare ]-> ai platform engineer . llm infrastructure

I build the layer between your application and the model, and I make it hold.

Scroll

1 million installs a month means someone else's production depends on your defaults.

I maintain langchain-litellm, LangChain's official interface to 100+ model providers, downloaded 15 million times and counting.

Portrait of Akshay Dongare

What I've built, and what it holds up under

1M installs every month

Creator and lead maintainer of LangChain's official LiteLLM integration. A project I started on my own that now lives and ships inside the langchain-ai organization. One Python interface to 100+ model providers, plus router-backed load balancing, embeddings and OCR loading. 15 million downloads to date, and around 1 million every month.

28 services, zero migrations

Agentic graphs, official sources only

Open source you can read. Production work you can check.

Most LLM systems don't fail at the model. They fail at the plumbing.

APPROACH
Read this diff on GitHub
# langchain-litellm · langchain_litellm/chat_models/litellm.py
# PR #161 remove global litellm module mutations from _client_params
 
@property
def _client_params(self) -> Dict[str, Any]:
- """Get the parameters used for the openai client."""
- set_model_value = self.model
- if self.model_name is not None:
- set_model_value = self.model_name
- self.client.api_base = self.api_base
- self.client.api_key = self.api_key
- for named_api_key in [
- "openai_api_key",
- "azure_api_key",
- "anthropic_api_key",
- "replicate_api_key",
- "cohere_api_key",
- "openrouter_api_key",
- ]:
- if api_key_value := getattr(self, named_api_key):
- setattr(
- self.client,
- named_api_key.replace("_api_key", "_key"),
- api_key_value,
- )
- self.client.organization = self.organization
+ """Get the parameters used for the OpenAI client."""
creds: Dict[str, Any] = {
- "model": set_model_value,
"timeout": self.request_timeout,
"api_base": self.api_base,
"api_key": self.api_key,
+ "organization": self.organization,
}
- # Forward any extra headers to the client and include in params
if self.extra_headers is not None:
- # set attribute on client for runtime usage
- setattr(self.client, "extra_headers", self.extra_headers)
creds["extra_headers"] = self.extra_headers
return {**self._default_params, **creds}
 
# and the test that keeps it fixed
# tests/unit_tests/test_litellm.py
 
+def test_client_params_does_not_mutate_litellm_globals() -> None:
+ """_client_params must not write instance config to litellm module globals. Fixes #132."""
+ before = {
+ "api_base": litellm.api_base,
+ "api_key": litellm.api_key,
+ "organization": getattr(litellm, "organization", None),
+ }
+
+ llm = ChatLiteLLM(
+ model="azure/gpt-4o",
+ api_base="https://my-azure.openai.azure.com",
+ api_key="azure-key",
+ organization="my-org",
+ extra_headers={"X-Custom": "value"},
+ )
+ params = llm._client_params
+
+ # globals must be untouched
+ assert litellm.api_base == before["api_base"]
+ assert litellm.api_key == before["api_key"]
+ assert getattr(litellm, "organization", None) == before["organization"]
+
+ # values must be present in the returned per-call params instead
+ assert params["api_base"] == "https://my-azure.openai.azure.com"
+ assert params["api_key"] == "azure-key"
+ assert params["organization"] == "my-org"
+ assert params["extra_headers"] == {"X-Custom": "value"}
 

Tell me what you're building.