- New: src/rag/engine/ — in-process hybrid search (FTS5 BM25 + sqlite-vec + LLM rerank) - New: src/rag/qmd/ — compatibility layer (qmd_query, qmd_chat, qmd_chat_stream, qmd_index_*) - New: src/ingest/stub_writer.py — .md stubs for binary files (videos, archives) - New: scripts/deploy.sh + scripts/pull_models.sh + Makefile + .env.example - Removed: LightRAG, sentence-transformers embedding via separate package, rag_standalone/ - Removed: @nousresearch/qmd npm dep (package not published); Node.js from Dockerfile - Updated: tests/ (46 passed), docker-compose, .dockerignore, config.yaml, README Engine: in-process Python (no daemon, no npm), sentence-transformers 384-dim, RRF fusion (k=60), BM25 + vector with numpy fallback. WebSocket API unchanged. Deploy: 'git clone' + 'make init' + 'make pull-models MODELS_SOURCE=...' + 'make up'. Models (5.83 GB) live outside git; pulled via rsync from dev host.
51 lines
1.8 KiB
Makefile
51 lines
1.8 KiB
Makefile
SHELL := /bin/bash
|
||
.DEFAULT_GOAL := help
|
||
|
||
# Detect whether `docker compose` v2 or `docker-compose` v1 is available
|
||
COMPOSE := $(shell command -v docker-compose 2>/dev/null || echo "docker compose")
|
||
|
||
.PHONY: help init pull-models up down restart logs status clean test deploy
|
||
|
||
help: ## Показать эту справку
|
||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||
|
||
init: ## Создать .env из .env.example (если его нет)
|
||
@if [ ! -f .env ]; then \
|
||
cp .env.example .env && \
|
||
echo "Created .env from .env.example"; \
|
||
echo "==> Edit .env with real secrets, then run: make deploy"; \
|
||
else \
|
||
echo ".env already exists, skipping"; \
|
||
fi
|
||
|
||
pull-models: ## Загрузить модели (rsync + fallback на download_models.py)
|
||
@bash scripts/pull_models.sh
|
||
|
||
up: ## Запустить контейнеры (build + -d)
|
||
$(COMPOSE) up --build -d
|
||
@$(COMPOSE) logs --tail=30 transcription || true
|
||
|
||
down: ## Остановить контейнеры
|
||
$(COMPOSE) down
|
||
|
||
restart: ## Перезапустить transcription
|
||
$(COMPOSE) restart transcription
|
||
|
||
logs: ## Логи transcription (follow)
|
||
$(COMPOSE) logs -f transcription
|
||
|
||
status: ## Статус контейнеров
|
||
$(COMPOSE) ps
|
||
@echo ""
|
||
@cmd /c "curl -s http://localhost:8000/api/health" 2>/dev/null || \
|
||
curl -s http://localhost:8000/api/health || \
|
||
echo "(service not responding on :8000)"
|
||
|
||
clean: ## Удалить контейнеры + volumes (ОСТОРОЖНО: стирает uploads/processed/data)
|
||
$(COMPOSE) down -v
|
||
|
||
test: ## Прогнать pytest
|
||
pytest tests/ -q
|
||
|
||
deploy: pull-models up ## Полный деплой: модели + запуск
|