Skip to content
Closed
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ my_config = RAGLiteConfig(
# Example 'local' config with a DuckDB database and a llama.cpp LLM:
my_config = RAGLiteConfig(
db_url="duckdb:///raglite.db",
llm="llama-cpp-python/unsloth/Qwen3-8B-GGUF/*Q4_K_M.gguf@8192",
llm="llama-cpp-python/unsloth/Qwen3.5-9B-GGUF/*Q4_K_M.gguf@8192",
embedder="llama-cpp-python/lm-kit/bge-m3-gguf/*F16.gguf@512", # More than 512 tokens degrades bge-m3's performance
)
```
Expand Down Expand Up @@ -386,7 +386,7 @@ RAGLite comes with an [MCP server](https://modelcontextprotocol.io) implemented
```
raglite \
--db-url duckdb:///raglite.db \
--llm llama-cpp-python/unsloth/Qwen3-4B-GGUF/*Q4_K_M.gguf@8192 \
--llm llama-cpp-python/unsloth/Qwen3.5-4B-GGUF/*Q4_K_M.gguf@8192 \
--embedder llama-cpp-python/lm-kit/bge-m3-gguf/*F16.gguf@512 \
mcp install
```
Expand Down Expand Up @@ -422,7 +422,7 @@ You can specify the database URL, LLM, and embedder directly in the Chainlit fro
```sh
raglite \
--db-url duckdb:///raglite.db \
--llm llama-cpp-python/unsloth/Qwen3-4B-GGUF/*Q4_K_M.gguf@8192 \
--llm llama-cpp-python/unsloth/Qwen3.5-4B-GGUF/*Q4_K_M.gguf@8192 \
--embedder llama-cpp-python/lm-kit/bge-m3-gguf/*F16.gguf@512 \
chainlit
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ dev = [
# Frontend:
chainlit = ["chainlit (>=2.0.0)"]
# Large Language Models:
llama-cpp-python = ["llama-cpp-python (>=0.3.9)"]
llama-cpp-python = ["llama-cpp-python (>=0.3.16)"] # Qwen 3.5 support
# Markdown conversion:
mistral-ocr = ["mistralai (>=1.10.1)"]
pandoc = ["pypandoc-binary (>=1.13)"]
Expand Down
4 changes: 2 additions & 2 deletions src/raglite/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class RAGLiteConfig:
# LLM config used for generation.
llm: str = field(
default_factory=lambda: (
"llama-cpp-python/unsloth/Qwen3-8B-GGUF/*Q4_K_M.gguf@8192"
"llama-cpp-python/unsloth/Qwen3.5-9B-GGUF/*Q4_K_M.gguf@8192"
if llama_supports_gpu_offload()
else "llama-cpp-python/unsloth/Qwen3-4B-GGUF/*Q4_K_M.gguf@8192"
else "llama-cpp-python/unsloth/Qwen3.5-4B-GGUF/*Q4_K_M.gguf@8192"
)
)
llm_max_tries: int = 4
Expand Down
2 changes: 1 addition & 1 deletion src/raglite/_litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LlamaCppPythonLLM(CustomLLM):
from litellm import completion

response = completion(
model="llama-cpp-python/unsloth/Qwen3-8B-GGUF/*Q4_K_M.gguf@8192",
model="llama-cpp-python/unsloth/Qwen3.5-9B-GGUF/*Q4_K_M.gguf@8192",
messages=[{"role": "user", "content": "Hello world!"}],
# stream=True
)
Expand Down
8 changes: 8 additions & 0 deletions src/raglite/_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ def _limit_chunkspans(
# Early exit if we're already under the limit
if total_tokens == 0 or total_tokens <= max_tokens:
return tool_chunk_spans
# If the context window is completely exhausted, return empty spans.
if max_tokens <= 0 or total_tokens == 0:
logger.warning(
"RAG context was limited to 0 out of %d chunks due to context window size. "
"Consider using a model with a bigger context window or reducing the number of retrieved chunks.",
total_chunk_spans,
)
return {tool_id: [] for tool_id in tool_chunk_spans}
# Allocate tokens proportionally and truncate
new_total_chunk_spans = 0
scale_ratio = max_tokens / total_tokens
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def database(request: pytest.FixtureRequest) -> str:
params=[
pytest.param(
(
"llama-cpp-python/unsloth/Qwen3-4B-GGUF/*Q4_K_M.gguf@8192", # mistralai/Ministral-3-3B-Instruct-2512
"llama-cpp-python/unsloth/Qwen3.5-4B-GGUF/*Q4_K_M.gguf@6144", # 8192 exceeds Metal GPU memory when embedding model is co-loaded.
"llama-cpp-python/lm-kit/bge-m3-gguf/*Q4_K_M.gguf@512", # More context degrades performance.
),
id="qwen3_4B-bge_m3",
id="qwen3.5_4B-bge_m3",
),
pytest.param(
("gpt-4o-mini", "text-embedding-3-small"),
Expand Down
6 changes: 3 additions & 3 deletions tests/test_chatml_function_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def is_accelerator_available() -> bool:
@pytest.mark.parametrize(
"llm_repo_id",
[
pytest.param("unsloth/Qwen3-4B-GGUF", id="qwen3_4B"),
pytest.param("unsloth/Qwen3.5-4B-GGUF", id="qwen3.5_4B"),
pytest.param(
"unsloth/Qwen3-8B-GGUF",
id="qwen3_8B",
"unsloth/Qwen3.5-9B-GGUF",
id="qwen3.5_9B",
marks=pytest.mark.skipif(
not is_accelerator_available(), reason="Accelerator not available"
),
Expand Down
Loading