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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ dmypy.json
/poetry.lock
/tilellm/modules/pdf_ocr/PDF_GRAPHRAG_INTEGRATION_PROPOSAL.md
/tilellm/modules/pdf_ocr/PDF_OCR_IMPLEMENTATION_STATUS.md
*vscode*
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
COMPOSE_FILE := ./docker/docker-compose.yml
ENV_FILE := ./docker/.env
PROFILE ?= app-base

.PHONY: up down restart ps logs logs-app logs-redis

up:
docker compose --env-file $(ENV_FILE) -f $(COMPOSE_FILE) --profile $(PROFILE) up --build -d

down:
docker compose --env-file $(ENV_FILE) -f $(COMPOSE_FILE) --profile $(PROFILE) down

restart: down up

ps:
docker compose --env-file $(ENV_FILE) -f $(COMPOSE_FILE) --profile $(PROFILE) ps

logs:
docker compose --env-file $(ENV_FILE) -f $(COMPOSE_FILE) --profile $(PROFILE) logs -f

logs-app:
docker compose --env-file $(ENV_FILE) -f $(COMPOSE_FILE) logs -f app-base app-graph app-ocr app-all

logs-redis:
docker compose --env-file $(ENV_FILE) -f $(COMPOSE_FILE) logs -f redis
12 changes: 6 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ services:
- ENABLE_PROFILER=${ENABLE_PROFILER}
- ENABLE_GRAPHRAG_FALKOR=${ENABLE_GRAPHRAG_FALKOR}
- FALKORDB_URI=${FALKORDB_URI}
- FALKORDB_MAX_CONNECTIONS="${FALKORDB_MAX_CONNECTIONS}
- FALKORDB_MAX_CONNECTIONS=${FALKORDB_MAX_CONNECTIONS}
- FALKORDB_SOCKET_TIMEOUT=${FALKORDB_SOCKET_TIMEOUT}
- FALKORDB_SOCKET_CONNECT_TIMEOUT=${FALKORDB_SOCKET_CONNECT_TIMEOUT}
- FALKORDB_SOCKET_KEEPALIVE=${FALKORDB_SOCKET_KEEPALIVE}
- FALKORDB_RETRY_ON_TIMEOUT="${FALKORDB_RETRY_ON_TIMEOUT}
- FALKORDB_RETRY_ON_TIMEOUT=${FALKORDB_RETRY_ON_TIMEOUT}
- ENABLE_GRAPHRAG=${ENABLE_GRAPHRAG}
- ENABLE_PDF_OCR=${ENABLE_PDF_OCR}
- ENABLE_CONVERSION=${ENABLE_CONVERSION}
Expand Down Expand Up @@ -88,11 +88,11 @@ services:
- ENABLE_GRAPHRAG=${ENABLE_GRAPHRAG}
- ENABLE_GRAPHRAG_FALKOR=${ENABLE_GRAPHRAG_FALKOR}
- FALKORDB_URI=${FALKORDB_URI}
- FALKORDB_MAX_CONNECTIONS="${FALKORDB_MAX_CONNECTIONS}
- FALKORDB_MAX_CONNECTIONS=${FALKORDB_MAX_CONNECTIONS}
- FALKORDB_SOCKET_TIMEOUT=${FALKORDB_SOCKET_TIMEOUT}
- FALKORDB_SOCKET_CONNECT_TIMEOUT=${FALKORDB_SOCKET_CONNECT_TIMEOUT}
- FALKORDB_SOCKET_KEEPALIVE=${FALKORDB_SOCKET_KEEPALIVE}
- FALKORDB_RETRY_ON_TIMEOUT="${FALKORDB_RETRY_ON_TIMEOUT}
- FALKORDB_RETRY_ON_TIMEOUT=${FALKORDB_RETRY_ON_TIMEOUT}
- ENABLE_PDF_OCR=${ENABLE_PDF_OCR}
- ENABLE_CONVERSION=${ENABLE_CONVERSION}
- ENABLE_TOOLS_REGISTRY=${ENABLE_TOOLS_REGISTRY}
Expand Down Expand Up @@ -129,11 +129,11 @@ services:
- ENABLE_GRAPHRAG=${ENABLE_GRAPHRAG}
- ENABLE_GRAPHRAG_FALKOR=${ENABLE_GRAPHRAG_FALKOR}
- FALKORDB_URI=${FALKORDB_URI}
- FALKORDB_MAX_CONNECTIONS="${FALKORDB_MAX_CONNECTIONS}
- FALKORDB_MAX_CONNECTIONS=${FALKORDB_MAX_CONNECTIONS}
- FALKORDB_SOCKET_TIMEOUT=${FALKORDB_SOCKET_TIMEOUT}
- FALKORDB_SOCKET_CONNECT_TIMEOUT=${FALKORDB_SOCKET_CONNECT_TIMEOUT}
- FALKORDB_SOCKET_KEEPALIVE=${FALKORDB_SOCKET_KEEPALIVE}
- FALKORDB_RETRY_ON_TIMEOUT="${FALKORDB_RETRY_ON_TIMEOUT}
- FALKORDB_RETRY_ON_TIMEOUT=${FALKORDB_RETRY_ON_TIMEOUT}
- ENABLE_PDF_OCR=${ENABLE_PDF_OCR}
- ENABLE_CONVERSION=${ENABLE_CONVERSION}
- ENABLE_TOOLS_REGISTRY=${ENABLE_TOOLS_REGISTRY}
Expand Down
10 changes: 9 additions & 1 deletion tilellm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from fastapi_cprofile.profiler import CProfileMiddleware
from fastapi.responses import JSONResponse
from pydantic import BaseModel

import asyncio
from redis.asyncio import Redis, from_url
Expand All @@ -35,7 +36,14 @@
RepositoryDescNamespaceResult, RepositoryItems, SimpleAnswer,
RepositoryEngine, RetrievalChunksResult)
from tilellm.models.schemas.general_schemas import AsyncTaskResponse
from tilellm.modules.knowledge_graph.models.schemas import TaskPollResponse
try:
from tilellm.modules.knowledge_graph.models.schemas import TaskPollResponse
except ImportError:
class TaskPollResponse(BaseModel):
task_id: str
status: str
result: dict | None = None
error: str | None = None

try:
from tilellm.modules.task_executor.tasks import task_scrape_item_single
Expand Down
2 changes: 1 addition & 1 deletion tilellm/models/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class QuestionAnswer(BaseModel):
tags: Optional[Union[str, List[str]]] = None
llm: Optional[str] = Field(default="openai")
gptkey: Optional[SecretStr] = "sk"
model: Union[str, LlmEmbeddingModel] = Field(default="gpt-3.5-turbo")
model: Union[str, LlmEmbeddingModel] = Field(default="gpt-4.1-nano")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent default model update across sibling classes

Low Severity

The default model in QuestionAnswer was updated to gpt-4.1-nano, but QuestionToLLM in the same file (line 242) still defaults to gpt-3.5-turbo. Both classes are used for user-facing API endpoints (/api/qa/* and /api/ask respectively), and before this change they shared the same default. This creates a new inconsistency where two similar request models silently resolve to different models depending on which endpoint a user hits without specifying a model.

Fix in Cursor Fix in Web

sparse_encoder: Union[str, "TEIConfig", None] = Field(default="splade") #bge-m3
temperature: float = Field(default=0.0)
top_k: int = Field(default=5)
Expand Down
14 changes: 9 additions & 5 deletions tilellm/store/pinecone/pinecone_repository_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import uuid
from abc import abstractmethod
import os

import time
import asyncio
Expand Down Expand Up @@ -119,13 +120,15 @@ async def _create_index_if_not_exists(self):
logger.info(f'Creating new index {self.engine.index_name}...')
try:
if self.engine.type == "serverless":
serverless_cloud = os.environ.get("PINECONE_SERVERLESS_CLOUD", "aws")
serverless_region = os.environ.get("PINECONE_SERVERLESS_REGION", "us-east-1")
await self._pc_client.create_index(
name=self.engine.index_name,
dimension=self.emb_dimension,
metric=self.engine.metric,
spec=pinecone.ServerlessSpec(
cloud="aws",
region="us-west-2"
cloud=serverless_cloud,
region=serverless_region
)
)
else: # Pod type
Expand Down Expand Up @@ -815,11 +818,13 @@ async def create_index_instance(engine, embeddings, emb_dimension) -> PineconeVe
logger.debug(f'Create index {engine.index_name} and embeddings ...')

if engine.type == "serverless": #os.environ.get("PINECONE_TYPE") == "serverless":
serverless_cloud = os.environ.get("PINECONE_SERVERLESS_CLOUD", "aws")
serverless_region = os.environ.get("PINECONE_SERVERLESS_REGION", "us-east-1")
await pc.create_index(engine.index_name, # const.PINECONE_INDEX,
dimension=emb_dimension,
metric=engine.metric,
spec=pinecone.ServerlessSpec(cloud="aws",
region="us-west-2"
spec=pinecone.ServerlessSpec(cloud=serverless_cloud,
region=serverless_region
)
)
else:
Expand Down Expand Up @@ -953,4 +958,3 @@ async def _create_vector_store_instance(engine, embeddings, emb_dimension) -> Ca