diff --git a/docker-compose.yaml b/docker-compose.yaml index 16bb67e..a0e1d73 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -37,7 +37,6 @@ services: args: - NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001 - network: host image: itzcrazykns1337/perplexica-frontend:main depends_on: - perplexica-backend diff --git a/sample.config.toml b/sample.config.toml index 259f58d..8933a95 100644 --- a/sample.config.toml +++ b/sample.config.toml @@ -17,6 +17,7 @@ API_KEY = "" [MODELS.DEEPSEEK] API_KEY = "" +STREAM_DELAY = 5 # Milliseconds between token emissions for reasoning models (higher = slower, 0 = no delay) [MODELS.OLLAMA] API_URL = "" # Ollama API URL - http://host.docker.internal:11434 diff --git a/src/config.ts b/src/config.ts index 166d48e..5d31dbb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,6 +25,7 @@ interface Config { }; DEEPSEEK: { API_KEY: string; + STREAM_DELAY: number; }; OLLAMA: { API_URL: string; @@ -69,6 +70,9 @@ export const getGeminiApiKey = () => loadConfig().MODELS.GEMINI.API_KEY; export const getDeepseekApiKey = () => loadConfig().MODELS.DEEPSEEK.API_KEY; +export const getDeepseekStreamDelay = () => + loadConfig().MODELS.DEEPSEEK.STREAM_DELAY || 20; // Default to 20ms if not specified + export const getSearxngApiEndpoint = () => process.env.SEARXNG_API_URL || loadConfig().API_ENDPOINTS.SEARXNG; diff --git a/src/lib/providers/deepseek.ts b/src/lib/providers/deepseek.ts index baae1c5..e03503c 100644 --- a/src/lib/providers/deepseek.ts +++ b/src/lib/providers/deepseek.ts @@ -1,7 +1,7 @@ import { ReasoningChatModel } from '../reasoningChatModel'; import { ChatOpenAI } from '@langchain/openai'; import logger from '../../utils/logger'; -import { getDeepseekApiKey } from '../../config'; +import { getDeepseekApiKey, getDeepseekStreamDelay } from '../../config'; import axios from 'axios'; interface DeepSeekModel { @@ -54,6 +54,9 @@ export const loadDeepSeekChatModels = async (): Promise