Chatbot sobre League of Legends que combina dos piezas:
- Retrieval (notebook) —
sentence-transformers(paraphrase-multilingual-MiniLM-L12-v2) genera embeddings 384d y elige la entrada del Knowledge Base más cercana por cosine similarity (esto esQ·Kᵀa nivel de oraciones, verlol_chatbot.ipynb). - Generation — el contexto recuperado se inyecta como system + user prompt
a un modelo Ollama tiny (
qwen2.5:0.5b, ~400 MB) que reformula la respuesta en español coloquial gamer.
backend/ FastAPI + RAG + Ollama
frontend/ Astro + Tailwind (dark glass UI)
lol_chatbot.ipynb notebook original (intacto)
- Python ≥ 3.14,
uv - Node ≥ 20, npm
- Ollama corriendo local (
ollama serve) conqwen2.5:0.5b:curl -fsSL https://ollama.com/install.sh | sh ollama pull qwen2.5:0.5b
Backend (puerto 8000):
uv sync
uv run python main.py
# o: uv run uvicorn backend.app:app --reloadFrontend (puerto 4321):
cd frontend
npm install
npm run devAbre http://127.0.0.1:4321.
Variables de entorno:
| Var | Default | Descripción |
|---|---|---|
OLLAMA_HOST |
http://127.0.0.1:11434 |
Endpoint de Ollama |
OLLAMA_MODEL |
qwen2.5:0.5b |
Modelo de generación |
PUBLIC_BACKEND_URL (frontend) |
http://127.0.0.1:8000 |
URL del backend |
GET /health→{ ok, model }POST /chat→{ message }→{ reply, matched_question, matched_answer, score, below_threshold }