Feat/m1 rag free path - #1
Merged
Merged
Conversation
Free AI path: - Embeddings via local fastembed (BAAI/bge-small-en-v1.5, dim 384), provider-switchable (local|openai); model baked into images at build - Generation/vision via OpenRouter (OpenAI-compatible base_url), free models - Migration 0002: resize chunks.embedding 1536 -> 384, recreate HNSW index - Config + .env.example: OPENROUTER_*, GENERATION/VISION_MODEL, EMBEDDING_PROVIDER M1 ingest (worker): fetch(S3) -> parse(txt/pdf/docx) -> chunk(sentence-aware + overlap) -> embed -> upsert into pgvector; status transitions + retries. API upload now stores to MinIO and enqueues the Celery task; list_documents real. M1 query (api): workspace-scoped pgvector retrieval -> grounded-by-default generation with citations or "not found"; conversation/message persistence; SSE token streaming. Generation failures degrade to retrieved context. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- apiClient: correct response types (document_id/task_id, conversation_id, DocumentInfo); add streamQuery() — POST SSE parser (EventSource is GET-only) - ChatPage: token-by-token streaming, threads conversation_id across turns, live citations - UploadPage: list documents from API, poll status while pending/processing, color-coded indexed/failed - query/stream: persist user+assistant messages, emit conversation_id in meta so streaming supports multi-turn - override: fix VITE_API_URL to http://api:8000 (Vite dev proxy runs inside the web container, so localhost is wrong) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Free ":free" models are often rate-limited upstream (429) or temporarily unavailable (404). chat() and stream_chat() now try a configured list of 10 free models in order, skipping on 404/429/502/503 to the next, so a grounded answer still returns. Streaming falls back only before the first token. Default primary switched to qwen3-next-80b (llama-3.3-70b was saturated upstream). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- query: log start/context/decision/done; retrieval logs embed + hit counts, top similarity, kept sources; llm logs each model try/ok/fallback and stream_start/done — full trace of a request in dev logs - ingest worker: log fetched/parsed/chunked/embedded/upserted steps - override: PYTHONUNBUFFERED=1 (api+worker) so logs flush in real time/order - llm client: max_retries=0 so a rate-limited model falls back in ~1s instead of the SDK stalling ~50s on its own 429 retries (surfaced by the new logs) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- ingest: add GET /documents/:id/download and DELETE /documents/:id endpoints - storage: add download_bytes() and delete_object() helpers - query: done event now carries grounded+citations; ChatPage patches msg on receipt - apiClient: fix SSE parser for CRLF, expose deleteDocument + downloadDocument - UploadPage: status dot, download/delete buttons with confirm modal - vite.config: set hmr.port=3000 so WebSocket works through Docker's exposed port Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.