Spaces:
Runtime error
Runtime error
Commit History
-
Reduce post-model chat response overhead
- Remove extra user/user_session round-trips in save path - Use atomic SQL prompt_count increment guard - Return ChatResponse DTO directly after commit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>4530ab0 -
Restore Gemma primary and cut post-model API delay
- Revert OpenRouter default model back to google/gemma-4-26b-a4b-it - Auto-migrate stale llama/deepseek defaults back to configured OpenRouter model - Reduce chat response path DB round-trips by flushing without refresh - Defer target-achieved websocket broadcast until after DB commit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>7012a06 -
Switch primary OpenRouter model to Meta Llama
- Set backend default OPENROUTER_MODEL to meta-llama/llama-3.1-8b-instruct - Auto-migrate legacy deepseek/gemma admin model values to new default Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>582eadf -
Add multi-user mode to load test script
- Support LOADTEST_USER_CREDENTIALS for realistic concurrent-user testing - Log in per worker and keep separate cookie sessions - Retain token mode for single-user tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>2b14a4b -
Improve Gemma failover and load-test realism
- Keep Gemma primary but fail over faster to fallback models on timeout - Replace hardcoded 5/min decorator with admin-configured per-minute enforcement - Enhance load-test script with cookie-auth login path and failure code reporting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>a0c464d -
Fix cookie set compatibility in load script
- Remove unsupported secure kwarg for httpx Cookies.set - Prefer login credentials over stale token env when both are set Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>082aeff -
Fix load test auth for cookie-based backend
- Use access_token cookie instead of Authorization header - Support login-based token fetch via LOADTEST_LOGIN_EMAIL/PASSWORD - Keep workers alive on per-request failures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>5fae813 -
Scale runtime for 20-user target load
- Move user page to WebSocket-first updates with low-frequency fallback polling - Add in-process caching for active sessions and recent notifications - Broadcast session/notification snapshots to reduce read amplification - Add adaptive chat history compaction under high LLM load - Add configurable multi-worker startup and load-test script for p95 tuning Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>decd9fb -
Fix OpenRouter runtime error on HF
- Add h2 dependency for httpx HTTP/2 support - Gracefully fallback to HTTP/1.1 if HTTP/2 extras are unavailable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>10d1d55 -
Unblock HF startup by de-risking Alembic boot
- Skip startup upgrade when alembic_version already exists - Use sync MySQL URL for Alembic operations - Add PyMySQL dependency for Alembic sync driver Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>8417c81 -
Prevent HF startup hangs during DB init
- Add startup migration/seed timeouts and phase logging - Add migration timeout recovery by stamping existing schema - Add env controls for startup timeout tuning Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>49c17a2 -
Add runtime request and release diagnostics
- Log startup release and active LLM defaults - Log every HTTP request path/status/latency - Expose release/environment in /health - Add APP_RELEASE to env template Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>6ef84a1 -
Harden OpenRouter routing and runtime observability
- Make gemma model the OpenRouter backend default - Migrate legacy admin DB LLM defaults to env-driven provider/model on startup - Add explicit chat dispatch/completion logs and OpenRouter attempt logs - Fail fast when NEXT_PUBLIC_API_URL is missing in deployed frontend - Default admin settings form to OpenRouter gemma model Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>4ed5f9b -
Fix chat model-error handling and user round auto-load
- Prevent quota consumption on warning/error model responses - Auto-refresh and auto-select active sessions on user chat page - Add runtime issue/fix markdown from deep inspection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>ddadcef -
Harden model/provider config to stop persistent model errors
- Auto-heal invalid admin LLM settings - Validate admin llm_provider/llm_model inputs - Fallback unknown providers before generation - Add richer provider/model error logging Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>6790a51 -
Add multi-model OpenRouter failover for model errors
- Try requested/default/fallback/candidate models in sequence - Add OPENROUTER_FALLBACK_MODELS configuration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>2f996e4 -
Set DeepSeek as OpenRouter default with fallback
- Default OPENROUTER_MODEL to deepseek/deepseek-chat-v3-0324 - Add OPENROUTER_FALLBACK_MODEL retry path - Update env template for model configuration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>dd8b89a -
Tune response latency for concurrent user load
- Add LLM token/output/transport tuning controls - Reuse HTTP clients with keepalive for provider calls - Trim chat context by message char limits - Lower chat timeout budget for faster failure and recovery Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>e55a0df -
Improve latency path and 20-user scalability
- Add performance audit markdown with issues and fixes - Make DB pool and LLM concurrency configurable - Reduce chat context size with configurable history limit - Parallelize websocket broadcast sends - Avoid login failure from immediate /auth/me race Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>31a6bb6 -
Fix HF iframe embed and production auth over proxy
- Trust x-forwarded-proto for HTTPS cookie enforcement - Disable DENY frame header on *.hf.space and allow huggingface.co frame-ancestors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>d941795 -
Fix Vercel login fetch failures for HF backend
- Add Vercel origin regex support for CORS - Widen CORS methods/headers for browser preflight - Set secure/samesite cookies based on forwarded HTTPS - Auto-upgrade non-local API URL to https on frontend Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>fbffba1 -
Add Alembic recovery for existing/partial schemas
- Stamp head if upgrade fails against already-created tables Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>64112c4 -
Fix HF startup migration loop on pre-existing schemas
- Detect legacy tables without alembic_version - Stamp Alembic head before startup when schema already exists Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>24f9e79 -
Fix HF Space configuration metadata
- Add backend README with Docker Space front matter - Stop ignoring backend README in git Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>04b2cba -
Harden backend/frontend and clean repo artifacts
- Fix chat timeout and response handling reliability - Add Alembic migrations and MySQL-safe initial schema - Improve auth/security headers and frontend error handling - Remove temporary/refactor artifacts and redundant files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>d3ec15e -
Fix SameSite cookie policy for cross-domain requests
Copilot1fa03dc -
Configure production environment: Aiven DB, HuggingFace Backend, Vercel ready
Copilotd747394 -
feat: add Docker containerization, orchestration, and async database configuration
Copilot603b28a
-
fix: resolve all UPGRADED_DEEP_REPO_AUDIT critical issues
CopilotBackend: - config.py: remove hardcoded SECRET_KEY, ADMIN_PASSWORD, TARGET_OUTPUT defaults (raises ValidationError at startup if unset) [Issue 1.1, 5.3] - config.py: add ALLOWED_ORIGINS env var for dynamic CORS configuration [Issue 5.10] - auth.py: cookie-only token extraction (remove Bearer header fallback) [Issue 5.1] - auth.py: add JTI-based token blocklist for proper logout revocation [Issue 5.2] - models.py: UniqueConstraint on user_sessions(user_id, session_id) [DB Audit] - models.py: ondelete=CASCADE on all FK columns + ORM cascade=delete-orphan [Issue 5.9] - models.py: add missing DB indexes (sessions.status, users.created_at, notifications.created_at, audit_logs.created_at) [DB Audit] - schemas.py: ChatSend.prompt max_length=2000, password min_length=8 [Issue 5.8, 7.6] - crud.py: centralize _get_admin_settings to remove duplication [Issue 3.5] - main.py: health check now async + tests real DB connectivity [Issue 5.5] - main.py: CORS uses configurable ALLOWED_ORIGINS, restri…cbcf0fb -
feat: async backend refactor + upgraded deep repo audit
Copilot- Migrated from pymysql to asyncmy for fully async DB access - Converted database.py to use AsyncEngine and async_sessionmaker - Added composite indexes to UserSession and Message models - Refactored all routes (admin, chat, public, auth) to async/await - Eliminated N+1 query patterns with selectinload - Migrated OpenAI/OpenRouter to AsyncOpenAI to prevent event-loop blocking - Added asyncio.Semaphore(5) to cap concurrent LLM calls - DB session now released before LLM call and re-opened only to save result - Integrated slowapi for in-memory rate limiting without Redis - Migrated auth from localStorage JWT to HttpOnly SameSite=lax cookies - Refactored lib/api.ts to use credentials: include (no localStorage) - Rewrote AuthProvider to recover session via /auth/me cookie check - Added exponential backoff WebSocket reconnection in user/page.tsx - Fixed WebSocket user_id parsing to use explicit integer type - Added DEEP_REPO_AUDIT.md and UPGRADED_DEEP_REPO_AUDIT.md audit reports6b6e420 -
updated files
cf769b1
-
updated to work with openrouter
98f37b2
-
deleted cache
3a31040 -
configured backend
cb22dd9 -
added API Routes
f64709b -
added requirments
27c096a