[PR #2405] [CLOSED] Add documentation for using LiteLLM with ChatOpenAI #2404

Closed
opened 2026-02-17 17:23:23 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2405
Author: @Pratyay-ops
Created: 1/29/2026
Status: Closed

Base: mainHead: main


📝 Commits (3)

  • b19a8eb Enhance LiteLLM documentation with examples and setup
  • c23086f Update LiteLLM integration documentation
  • 1640ad4 Fix formatting for environment variable export section

📊 Changes

1 file changed (+87 additions, -2 deletions)

View changed files

📝 src/oss/python/integrations/providers/litellm.mdx (+87 -2)

📄 Description

Description:
This PR adds documentation describing an undocumented but functional integration pattern for using LiteLLM as a backend for LangChain’s ChatOpenAI.

The guide explains how to configure api_key, base_url, and extra_body.allowed_openai_params to ensure compatibility with LiteLLM’s request validation model.

Why:
LiteLLM is frequently used as an OpenAI-compatible proxy, but LangChain does not currently document how to integrate with it safely. This documentation reduces trial-and-error and prevents silent request failures.

Scope:

  • Documentation only
  • No code changes
  • No dependency changes

🧪 Testing Notes

Tested locally using:

  • LiteLLM proxy (local)
  • Hosted model configured in LiteLLM
  • ChatOpenAI.invoke() with parameter allowlisting

A minimal test script can be included separately if needed.
liteLLM test.py

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

Additional notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/2405 **Author:** [@Pratyay-ops](https://github.com/Pratyay-ops) **Created:** 1/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`b19a8eb`](https://github.com/langchain-ai/docs/commit/b19a8eb39d6548866a4bf04e898efa4726f815f8) Enhance LiteLLM documentation with examples and setup - [`c23086f`](https://github.com/langchain-ai/docs/commit/c23086f3e122a8c3dcf769b7acd18677e2f37ae8) Update LiteLLM integration documentation - [`1640ad4`](https://github.com/langchain-ai/docs/commit/1640ad46463ccf317882707d4439997e264a2715) Fix formatting for environment variable export section ### 📊 Changes **1 file changed** (+87 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/python/integrations/providers/litellm.mdx` (+87 -2) </details> ### 📄 Description **Description:** This PR adds documentation describing an undocumented but functional integration pattern for using LiteLLM as a backend for LangChain’s `ChatOpenAI`. The guide explains how to configure `api_key`, `base_url`, and `extra_body.allowed_openai_params` to ensure compatibility with LiteLLM’s request validation model. **Why:** LiteLLM is frequently used as an OpenAI-compatible proxy, but LangChain does not currently document how to integrate with it safely. This documentation reduces trial-and-error and prevents silent request failures. **Scope:** - Documentation only - No code changes - No dependency changes --- ## 🧪 Testing Notes Tested locally using: - LiteLLM proxy (local) - Hosted model configured in LiteLLM - `ChatOpenAI.invoke()` with parameter allowlisting A minimal test script can be included separately if needed. [liteLLM test.py](https://github.com/user-attachments/files/24950446/liteLLM.test.py) ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x] I have read the [contributing guidelines](README.md) - [x] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [x] I have updated navigation in `src/docs.json` if needed ## Additional notes <!-- Any other information that would be helpful for reviewers --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:23:23 -05:00
yindo changed title from [PR #2405] Add documentation for using LiteLLM with ChatOpenAI to [PR #2405] [CLOSED] Add documentation for using LiteLLM with ChatOpenAI 2026-06-05 18:18:23 -04:00
yindo closed this issue 2026-06-05 18:18:24 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#2404