diff --git a/backend/ai/generic_openai_provider.py b/backend/ai/generic_openai_provider.py index be51272..d18d02e 100644 --- a/backend/ai/generic_openai_provider.py +++ b/backend/ai/generic_openai_provider.py @@ -60,7 +60,7 @@ class GenericOpenAIProvider(OpenAIProvider): ) create_kwargs = dict( model=self._model, - max_tokens=1024, + max_tokens=4096, messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_msg}, @@ -87,7 +87,7 @@ class GenericOpenAIProvider(OpenAIProvider): ) create_kwargs = dict( model=self._model, - max_tokens=256, + max_tokens=1024, messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_msg}, diff --git a/backend/ai/provider_config.py b/backend/ai/provider_config.py index 020e0f3..244443c 100644 --- a/backend/ai/provider_config.py +++ b/backend/ai/provider_config.py @@ -83,16 +83,17 @@ PROVIDER_DEFAULTS: dict[str, dict] = { }, "lmstudio": { "base_url": "http://host.docker.internal:1234/v1", - "model": "gemma-4-e4b-it", - "context_chars": 8_000, + "model": "qwen/qwen3.5-9b", + "context_chars": 32_000, }, } # Whether the provider honours response_format={"type": "json_object"}. # Gemini's OpenAI-compat endpoint does NOT support the string form (D-02/D-03). -# Ollama and LMStudio accept the parameter but some models ignore it — the -# GenericOpenAIProvider always wraps the raw response with parse_classification() -# regardless, so they are left as True (the parameter is still sent). +# LMStudio only accepts "json_schema" or "text" (not "json_object") — set False +# so GenericOpenAIProvider omits response_format and relies on parse_classification(). +# Ollama accepts the parameter but some models ignore it — left True; the +# GenericOpenAIProvider always wraps the raw response with parse_classification(). SUPPORTS_JSON_MODE: dict[str, bool] = { "openai": True, "anthropic": True, @@ -103,5 +104,5 @@ SUPPORTS_JSON_MODE: dict[str, bool] = { "openrouter": True, "mistral": True, "ollama": True, - "lmstudio": True, + "lmstudio": False, } diff --git a/docker-compose.yml b/docker-compose.yml index 9cbc1cf..3c625d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -102,6 +102,7 @@ services: - CLOUD_CREDS_KEY=${CLOUD_CREDS_KEY} - SECRET_KEY=${SECRET_KEY} - PYTHONDONTWRITEBYTECODE=1 + - PYTHONPATH=/app labels: logging: "promtail" volumes: @@ -134,6 +135,7 @@ services: - MINIO_BUCKET=${MINIO_BUCKET} - REDIS_URL=${REDIS_URL} - PYTHONDONTWRITEBYTECODE=1 + - PYTHONPATH=/app extra_hosts: - "host.docker.internal:host-gateway" command: celery -A celery_app beat --loglevel=info --schedule /tmp/celerybeat-schedule