Skip to content

fix: ollama model provider can not set 'num_ctx' etc. parameter #2442#2444

Merged
shaohuzhang1 merged 1 commit into1Panel-dev:mainfrom
jacksoja:main
Feb 28, 2025
Merged

fix: ollama model provider can not set 'num_ctx' etc. parameter #2442#2444
shaohuzhang1 merged 1 commit into1Panel-dev:mainfrom
jacksoja:main

Conversation

@itaa
Copy link
Copy Markdown
Contributor

@itaa itaa commented Feb 28, 2025

langchain-openai is not compatible with parameter Settings in ollama, such as num_ctx. Therefore, you need to create model instances using langchain-ollama

What this PR does / why we need it?

fix: ollama model provider can not set 'num_ctx' etc. parameter #2442

Summary of your change

  1. pyproject.toml add langchain-ollama = "0.1.3"
  2. apps/setting/models_provider/impl/ollama_model_provider/model/llm.py
    using langchain_ollama.chat_models ChatOllama and fit langchain-ollama parameter

Please indicate you've done the following:

  • [✅] Made sure tests are passing and test coverage is added if needed.
  • [✅] Made sure commit message follow the rule of Conventional Commits specification.
  • [✅] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

…l-dev#2442

langchain-openai is not compatible with parameter Settings in ollama, such as num_ctx. Therefore, you need to create model instances using langchain-ollama

(cherry picked from commit 42ae7b4)
@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Feb 28, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Feb 28, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shaohuzhang1 shaohuzhang1 merged commit ed8f8f8 into 1Panel-dev:main Feb 28, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants