Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatOllama is missing the parameters seed and base_url #24703

Closed
5 tasks done
chriss1245 opened this issue Jul 26, 2024 · 9 comments
Closed
5 tasks done

ChatOllama is missing the parameters seed and base_url #24703

chriss1245 opened this issue Jul 26, 2024 · 9 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@chriss1245
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

When running:

from langchain_ollama import ChatOllama
llm = ChatOllama(
    model=MODEL_NAME,
    base_url=BASE_URL,
    seed=42
)

The parameters base_url and seed get ignored. Reviewing the code of this instance, I see that the class definition is missing these attributes.

Error Message and Stack Trace (if applicable)

No response

Description

Regarding seed, in PR 249 in ollama, this feature was added to allow reproducibility of the experiments.
Regarding base_url, since ollama allow us to host llms in our own servers, we need to be able to specify the url of the server.

Plus in OllamaFunctions from the package langchain_experimental does provide support to this.

System Info

langchain==0.2.11
langchain-chroma==0.1.2
langchain-community==0.2.10
langchain-core==0.2.23
langchain-experimental==0.0.63
langchain-groq==0.1.6
langchain-ollama==0.1.0
langchain-text-splitters==0.2.2

@chriss1245 chriss1245 changed the title ChatOllama is missing the parameter seed and base_url ChatOllama is missing the parameters seed and base_url Jul 26, 2024
@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jul 26, 2024
@noggynoggy
Copy link
Contributor

I'm looking into it. I'll PR if I come to a nice solution

@noggynoggy
Copy link
Contributor

There are actually more Options missing.
If you compare whats available with what is implemented, you can see that there are way more options. I have to be honest though, I don't know what half of the options even do. So I'll focus on the base_url and the seed for now. The URL part i have working already.

@chriss1245
Copy link
Author

chriss1245 commented Jul 27, 2024

Sounds good. To be honest me neither. I mentioned seed and base_url cause i use those. Thanks a lot!

@Talhavaival1
Copy link

@noggynoggy I also use Base URL , would appreciate if you could create a PR and get it merged.

@noggynoggy
Copy link
Contributor

The base_url functionality was added by #24719. Maybe ill add the other Parameters later with a PR

@michaelgfeldman
Copy link

Can you please add seed parameters. It's also kind of an essential one.

ccurme pushed a commit that referenced this issue Jul 29, 2024
## Description

Adds seed parameter to ChatOllama

## Resolves Issues
- #24703

## Dependency Changes
None

Co-authored-by: Lennart J. Kurzweg (Nx2) <git@nx2.site>
@noggynoggy
Copy link
Contributor

noggynoggy commented Jul 30, 2024

@chriss1245 you can close this issue. Both have been implemented.

The latest release does not include the changes yet, so in the meantime:

wget https://raw.githubusercontent.com/langchain-ai/langchain/master/libs/partners/ollama/langchain_ollama/chat_models.py -O .venv/lib/python3.11/site-packages/langchain_ollama/chat_models.py 

make sure the path works for you (venv name, python version)

@chriss1245
Copy link
Author

Sure, thanks a lot!

@Steffanic
Copy link

Thanks for doing this, I've been so confused!

olgamurraft pushed a commit to olgamurraft/langchain that referenced this issue Aug 16, 2024
…#24782)

## Description

Adds seed parameter to ChatOllama

## Resolves Issues
- langchain-ai#24703

## Dependency Changes
None

Co-authored-by: Lennart J. Kurzweg (Nx2) <git@nx2.site>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants