Skip to content
Open
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
10 changes: 10 additions & 0 deletions core/quivr_core/llm/llm_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,16 @@ def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()):
max_tokens=config.max_output_tokens,
temperature=config.temperature,
)
elif config.supplier == DefaultModelSuppliers.AVIAN:
_llm = ChatOpenAI(
model=config.model,
api_key=SecretStr(config.llm_api_key)
if config.llm_api_key
else None,
base_url=config.llm_base_url or "https://api.avian.io/v1",
max_completion_tokens=config.max_output_tokens,
temperature=config.temperature,
)

else:
_llm = ChatOpenAI(
Expand Down
19 changes: 19 additions & 0 deletions core/quivr_core/rag/entities/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class DefaultModelSuppliers(str, Enum):
MISTRAL = "mistral"
GROQ = "groq"
GEMINI = "gemini"
AVIAN = "avian"


class LLMConfig(QuivrBaseConfig):
Expand Down Expand Up @@ -275,6 +276,24 @@ class LLMModelConfig:
tokenizer_hub="Quivr/gemini-tokenizer",
),
},
DefaultModelSuppliers.AVIAN: {
"deepseek/deepseek-v3.2": LLMConfig(
max_context_tokens=164000,
max_output_tokens=65000,
),
"moonshotai/kimi-k2.5": LLMConfig(
max_context_tokens=131000,
max_output_tokens=8192,
),
"z-ai/glm-5": LLMConfig(
max_context_tokens=131000,
max_output_tokens=16384,
),
"minimax/minimax-m2.5": LLMConfig(
max_context_tokens=1000000,
max_output_tokens=1000000,
),
},
}

@classmethod
Expand Down
20 changes: 19 additions & 1 deletion core/tests/test_llm_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from langchain_core.language_models import FakeListChatModel
from pydantic import ValidationError
from quivr_core.rag.entities.config import LLMEndpointConfig
from quivr_core.rag.entities.config import DefaultModelSuppliers, LLMEndpointConfig
from quivr_core.llm import LLMEndpoint


Expand Down Expand Up @@ -46,3 +46,21 @@ def test_llm_endpoint_constructor():
)

assert not llm_endpoint.supports_func_calling()


@pytest.mark.base
def test_llm_endpoint_avian():
from langchain_openai import ChatOpenAI

config = LLMEndpointConfig(
supplier=DefaultModelSuppliers.AVIAN,
model="deepseek/deepseek-v3.2",
llm_api_key="test",
)
llm = LLMEndpoint.from_config(config)

assert llm.supports_func_calling()
assert isinstance(llm._llm, ChatOpenAI)
assert llm._llm.openai_api_base == "https://api.avian.io/v1"
assert config.max_output_tokens == 65000
assert config.max_context_tokens <= 164000