File tree Expand file tree Collapse file tree
deployment/config/rag-pipeline
python-ecosystem/rag-pipeline/src/rag_pipeline/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ REDIS_URL=redis://redis:6379/1
5050# OLLAMA_BATCH_SIZE=100
5151
5252# # Request timeout in seconds (increase for slow CPU)
53+ # OPENROUTER_TIMEOUT=300
5354# OLLAMA_TIMEOUT=120
5455
5556# # CPU Threading Optimization (set based on your CPU cores)
Original file line number Diff line number Diff line change 44"""
55
66import logging
7+ import os
78from typing import Union
89
910from llama_index .core .base .embeddings .base import BaseEmbedding
@@ -37,12 +38,13 @@ def create_embedding_model(config: RAGConfig) -> BaseEmbedding:
3738 )
3839
3940 elif provider == "openrouter" :
40- logger .info (f"Creating OpenRouter embedding model: { config .openrouter_model } " )
41+ timeout = float (os .getenv ("OPENROUTER_TIMEOUT" , "300" ))
42+ logger .info (f"Creating OpenRouter embedding model: { config .openrouter_model } (timeout={ timeout } s)" )
4143 return OpenRouterEmbedding (
4244 api_key = config .openrouter_api_key ,
4345 model = config .openrouter_model ,
4446 api_base = config .openrouter_base_url ,
45- timeout = 60.0 ,
47+ timeout = timeout ,
4648 max_retries = 3 ,
4749 expected_dim = config .embedding_dim
4850 )
You can’t perform that action at this time.
0 commit comments