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

fix: llm model name #2830

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/core/quivr_core/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()):
from langchain_openai import ChatOpenAI

_llm = ChatOpenAI(
name=config.model,
model=config.model,
api_key=SecretStr(config.llm_api_key) if config.llm_api_key else None,
base_url=config.llm_base_url,
)
Expand Down
11 changes: 11 additions & 0 deletions backend/core/tests/test_llm_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ def test_llm_endpoint_from_config_default():
assert llm._llm.model_name in llm.get_config().model


def test_llm_endpoint_from_config():
config = LLMEndpointConfig(
model="llama2", llm_api_key="test", llm_base_url="http://localhost:8441"
)
llm = LLMEndpoint.from_config(config)

assert not llm.supports_func_calling()
assert isinstance(llm._llm, ChatOpenAI)
assert llm._llm.model_name in llm.get_config().model


def test_llm_endpoint_constructor():
llm_endpoint = FakeListChatModel(responses=[])
llm_endpoint = LLMEndpoint(
Expand Down
Loading