mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-11 16:52:38 +02:00
Initialize vision LLM router at app and celery startup
This commit is contained in:
parent
6d85821ae9
commit
4a675b64f4
2 changed files with 13 additions and 2 deletions
|
|
@ -25,7 +25,12 @@ from app.agents.new_chat.checkpointer import (
|
||||||
close_checkpointer,
|
close_checkpointer,
|
||||||
setup_checkpointer_tables,
|
setup_checkpointer_tables,
|
||||||
)
|
)
|
||||||
from app.config import config, initialize_image_gen_router, initialize_llm_router
|
from app.config import (
|
||||||
|
config,
|
||||||
|
initialize_image_gen_router,
|
||||||
|
initialize_llm_router,
|
||||||
|
initialize_vision_llm_router,
|
||||||
|
)
|
||||||
from app.db import User, create_db_and_tables, get_async_session
|
from app.db import User, create_db_and_tables, get_async_session
|
||||||
from app.routes import router as crud_router
|
from app.routes import router as crud_router
|
||||||
from app.routes.auth_routes import router as auth_router
|
from app.routes.auth_routes import router as auth_router
|
||||||
|
|
@ -223,6 +228,7 @@ async def lifespan(app: FastAPI):
|
||||||
await setup_checkpointer_tables()
|
await setup_checkpointer_tables()
|
||||||
initialize_llm_router()
|
initialize_llm_router()
|
||||||
initialize_image_gen_router()
|
initialize_image_gen_router()
|
||||||
|
initialize_vision_llm_router()
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(seed_surfsense_docs(), timeout=120)
|
await asyncio.wait_for(seed_surfsense_docs(), timeout=120)
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,15 @@ def init_worker(**kwargs):
|
||||||
This ensures the Auto mode (LiteLLM Router) is available for background tasks
|
This ensures the Auto mode (LiteLLM Router) is available for background tasks
|
||||||
like document summarization and image generation.
|
like document summarization and image generation.
|
||||||
"""
|
"""
|
||||||
from app.config import initialize_image_gen_router, initialize_llm_router
|
from app.config import (
|
||||||
|
initialize_image_gen_router,
|
||||||
|
initialize_llm_router,
|
||||||
|
initialize_vision_llm_router,
|
||||||
|
)
|
||||||
|
|
||||||
initialize_llm_router()
|
initialize_llm_router()
|
||||||
initialize_image_gen_router()
|
initialize_image_gen_router()
|
||||||
|
initialize_vision_llm_router()
|
||||||
|
|
||||||
|
|
||||||
# Get Celery configuration from environment
|
# Get Celery configuration from environment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue