unsloth/studio/backend
Roland Tannous ee1ff2bb50 Studio: per-thread RAG chunking/mode overrides
Threads can now opt into late chunking or multimodal mode independently
of the KBs they reference. Per-thread settings persist in chat_settings
under thread:<id>:rag and fall back to the app-level defaults when the
thread hasn't set anything explicitly.

Backend (routes/rag.py)
- ThreadRagSettings / UpdateThreadRagSettingsRequest Pydantic models.
- GET/PUT /api/rag/threads/{thread_id}/settings backed by
  chat_settings (upsert_chat_settings_merge). Same (multimodal, late)
  constraint enforcement as the create + defaults endpoints.
- POST /api/rag/threads/{thread_id}/reingest now accepts the same
  body shape — if any field is set, the new settings are persisted
  via set_thread_rag_settings BEFORE the reingest, so subsequent
  uploads pick up the change too.
- upload_thread_document reads the per-thread settings and passes
  them through to _start_ingestion, replacing the previous hard-coded
  ('standard', 'text', RAG_EMBEDDING_MODEL) defaults.

Frontend
- rag-api.ts: ThreadRagSettings type + getThreadRagSettings /
  setThreadRagSettings wrappers. reingestThreadDocuments now accepts
  optional UpdateThreadRagSettingsRequest opts.
- rag-store.ts: threadSettings map keyed by threadId, plus
  loadThreadSettings / updateThreadSettings actions. reingestThread
  refreshes the local settings copy when opts were supplied.
- chat-settings-sheet.tsx Retrieval section: when source = thread,
  shows side-by-side Mode + Chunking selects above the documents
  list. Selecting a different value:
    - persists immediately if the thread has no docs
    - prompts "Re-index N documents?" if docs exist; on Yes calls
      reingestThread with the new opts, on No reverts the select
  The (multimodal, late) constraint is enforced via per-option
  disabled + tooltip, matching the KB create dialog.
2026-05-24 12:53:28 +04:00
..
assets Add Qwen3.6 inference defaults for Studio (#5065) 2026-04-16 11:42:42 -07:00
auth Studio: add RAG with hybrid search, reranker, chat integration 2026-05-23 18:46:15 +04:00
core Studio: multimodal RAG mode (Phase 3B-multimodal) 2026-05-24 12:33:08 +04:00
loggers Studio: stop truncating long log lines as suspected base64 (#5335) 2026-05-08 13:07:18 +04:00
models Studio: PDF / document attachments for Anthropic + OpenAI (#5689) 2026-05-22 06:22:57 -07:00
plugins fix(gh_client): fail fast on 401/403 auth errors instead of retrying forever (#5325) (#5329) 2026-05-08 21:57:41 +04:00
requirements Studio: layout-aware RAG parsers + heading-aware chunking (Phase 3A) 2026-05-24 11:10:13 +04:00
routes Studio: per-thread RAG chunking/mode overrides 2026-05-24 12:53:28 +04:00
state unsloth run: add --enable-tools/--disable-tools server-side tool policy (#5277) 2026-05-05 12:45:15 +04:00
storage Studio: schema + API plumbing for per-KB chunking strategy + mode 2026-05-24 11:54:38 +04:00
tests Studio: PDF / document attachments for Anthropic + OpenAI (#5689) 2026-05-22 06:22:57 -07:00
utils Studio: schema + API plumbing for per-KB chunking strategy + mode 2026-05-24 11:54:38 +04:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
_platform_compat.py Fix Studio crash on Anaconda/conda-forge Python (#4484) 2026-03-22 05:36:55 -07:00
colab.py Fix/studio colab button message: Add fallback message for Colab Studio button when proxy URL fails (#4866) 2026-04-05 21:57:45 -07:00
main.py Studio: add RAG with hybrid search, reranker, chat integration 2026-05-23 18:46:15 +04:00
run.py Studio: stop hint, Uvicorn log rename, reachability check + Mac UI CI retry hardening (#5503) 2026-05-17 07:44:06 -07:00
startup_banner.py Studio: stop hint, Uvicorn log rename, reachability check + Mac UI CI retry hardening (#5503) 2026-05-17 07:44:06 -07:00