[GH-ISSUE #1795] Langchain Ollama: OAuth2 authentication and URL parameters #78702

Closed
opened 2026-05-09 01:20:34 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @skye0402 on GitHub (Jan 5, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/1795

What this is about:
Add OAuth2 and basic authentication to the langchain Ollama libraries as well as flexible URLs and ports.

Why:
Not everyone runs Ollama on the local machine. As for me I run it on Kubernetes and use it always with its langchain library. For that proper authentication is required.

How:
I propose to keep Ollma "as-is" and let the wrapping platform define the authentication. That way, only the langchain components need enhancement to offer OAuth or basic authentication through parameters (".env").

Status:
I've already enhanced the Ollma libraries to use OAuth2 with Client Credentials. I'm happy to add Basic to it as well if there is interest to add the code to the main langchain libraries.
I'm talking about these classes:

  • ChatOllama
  • Ollama
  • OllamaEmbeddings

Let me know if/ how I can contribute my code to it.

Originally created by @skye0402 on GitHub (Jan 5, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/1795 **What this is about:** Add OAuth2 and basic authentication to the langchain Ollama libraries as well as flexible URLs and ports. **Why:** Not everyone runs Ollama on the local machine. As for me I run it on Kubernetes and use it always with its langchain library. For that proper authentication is required. **How:** I propose to keep Ollma "as-is" and let the wrapping platform define the authentication. That way, only the langchain components need enhancement to offer OAuth or basic authentication through parameters (".env"). **Status:** I've already enhanced the Ollma libraries to use OAuth2 with Client Credentials. I'm happy to add Basic to it as well if there is interest to add the code to the main langchain libraries. I'm talking about these classes: - ChatOllama - Ollama - OllamaEmbeddings Let me know if/ how I can contribute my code to it.
Author
Owner

@mxyng commented on GitHub (Jan 8, 2024):

This issue would be better served if it's created in the langchain repo. The integration is maintained by LangChain, not Ollama.

<!-- gh-comment-id:1881652969 --> @mxyng commented on GitHub (Jan 8, 2024): This issue would be better served if it's created in the [langchain](https://github.com/langchain-ai/langchain) repo. The integration is maintained by LangChain, not Ollama.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#78702