adding more support for custom openai BASE_URL deployments#38
Open
Barneyjm wants to merge 3 commits intolangchain-ai:mainfrom
Open
adding more support for custom openai BASE_URL deployments#38Barneyjm wants to merge 3 commits intolangchain-ai:mainfrom
Barneyjm wants to merge 3 commits intolangchain-ai:mainfrom
Conversation
8cbe3c7 to
856c14b
Compare
Enables configuration of custom base URLs for OpenAI-compatible APIs through environment variables. This supports: - Azure OpenAI endpoints - Custom proxy servers - Local LLM deployments (Ollama, LocalAI, vLLM, etc.) - Any OpenAI-compatible API Environment variables: - OPENAI_API_BASE: Custom endpoint URL (e.g., http://localhost:11434/v1 for Ollama) - OPENAI_API_TYPE: API type (set to 'azure' for Azure OpenAI) - OPENAI_API_VERSION: API version (required for Azure, e.g., '2024-02-01') - OPENAI_API_KEY: API key (optional for local endpoints like Ollama) When OPENAI_API_BASE is set, the runtime uses the custom endpoint instead of the default OpenAI API. Azure-specific headers are automatically applied when OPENAI_API_TYPE=azure. Local endpoints that don't require authentication (like Ollama) work without an API key. Examples: - Ollama: OPENAI_API_BASE=http://localhost:11434/v1 (no key needed) - Azure: OPENAI_API_BASE=https://your-resource.openai.azure.com OPENAI_API_TYPE=azure OPENAI_API_VERSION=2024-02-01 OPENAI_API_KEY=your-key
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
adding support for custom BASE_URL deployments of OpenAI. aligns with existing Langchain packages
Type of Change
Checklist
Screenshots (if applicable)
Add screenshots to demonstrate UI changes.
See highlighted box for custom base url being shown:
Additional Notes
Any additional information reviewers should know.