196 lines
5.6 KiB
YAML
196 lines
5.6 KiB
YAML
# INVENTARIO.yml - Local LLM Agent
|
|
# Version: 0.3.0
|
|
# Actualizado: 2026-01-20
|
|
|
|
metadata:
|
|
proyecto: local-llm-agent
|
|
version: 0.5.0
|
|
tipo: infrastructure
|
|
prioridad: P1
|
|
status: phase2-complete
|
|
completitud: 95%
|
|
descripcion: Gateway de LLM local para delegacion de tareas simples
|
|
ultima_actualizacion: 2026-01-20
|
|
|
|
stack:
|
|
backend:
|
|
framework: NestJS 10.x
|
|
runtime: Node.js 20 LTS
|
|
lenguaje: TypeScript 5.x
|
|
inference:
|
|
framework: FastAPI
|
|
runtime: Python 3.11
|
|
lenguaje: Python
|
|
database:
|
|
tipo: PostgreSQL 16
|
|
nombre: local_llm_dev
|
|
cache:
|
|
tipo: Redis
|
|
db: 9
|
|
|
|
servicios:
|
|
gateway:
|
|
puerto: 3160
|
|
path: apps/gateway
|
|
descripcion: API Gateway OpenAI-compatible
|
|
endpoints:
|
|
- path: /v1/chat/completions
|
|
metodo: POST
|
|
descripcion: Chat completion OpenAI-compatible
|
|
- path: /v1/models
|
|
metodo: GET
|
|
descripcion: Lista modelos disponibles
|
|
- path: /mcp/tools
|
|
metodo: GET
|
|
descripcion: Lista herramientas MCP
|
|
- path: /mcp/tools/:name
|
|
metodo: POST
|
|
descripcion: Ejecutar herramienta MCP
|
|
- path: /health
|
|
metodo: GET
|
|
descripcion: Health check
|
|
|
|
inference-engine:
|
|
puerto: 3161
|
|
path: apps/inference-engine
|
|
descripcion: Motor de inferencia Python
|
|
backends:
|
|
- nombre: ollama
|
|
puerto: 11434
|
|
status: mvp
|
|
- nombre: vllm
|
|
puerto: 8000
|
|
status: planned
|
|
|
|
modelos:
|
|
base:
|
|
- nombre: gpt-oss-20b
|
|
quantizacion: Q4_K_M
|
|
vram_mb: 14000
|
|
context_length: 16384
|
|
|
|
configuracion:
|
|
tiers:
|
|
small:
|
|
max_tokens: 512
|
|
max_context: 4096
|
|
latencia_target_ms: 500
|
|
main:
|
|
max_tokens: 2048
|
|
max_context: 16384
|
|
latencia_target_ms: 2000
|
|
|
|
mcp_tools:
|
|
- nombre: classify
|
|
descripcion: Clasificar texto en categorias
|
|
- nombre: extract
|
|
descripcion: Extraer datos estructurados
|
|
- nombre: rewrite
|
|
descripcion: Reescribir texto
|
|
- nombre: summarize
|
|
descripcion: Resumir texto
|
|
|
|
dependencias_externas:
|
|
- nombre: ollama
|
|
tipo: runtime
|
|
puerto: 11434
|
|
obligatorio: true
|
|
- nombre: redis
|
|
tipo: cache
|
|
puerto: 6379
|
|
db: 9
|
|
obligatorio: false
|
|
- nombre: postgresql
|
|
tipo: database
|
|
puerto: 5432
|
|
obligatorio: false
|
|
|
|
metricas:
|
|
archivos_totales: 42
|
|
lineas_codigo: 3500
|
|
test_coverage: 90 # 98 tests pasando (44 inference + 54 gateway)
|
|
documentacion_coverage: 95
|
|
|
|
documentacion:
|
|
status: completa
|
|
archivos:
|
|
- path: docs/README.md
|
|
descripcion: Indice de documentacion
|
|
- path: docs/00-vision-general/ARQUITECTURA-LOCAL-LLM.md
|
|
descripcion: Arquitectura del sistema
|
|
- path: docs/10-arquitectura/MODELO-DATOS-OBJETOS.md
|
|
descripcion: Modelo de datos y objetos
|
|
- path: docs/50-requerimientos/RF-REQUERIMIENTOS-FUNCIONALES.md
|
|
descripcion: Requerimientos funcionales
|
|
- path: docs/50-requerimientos/RNF-REQUERIMIENTOS-NO-FUNCIONALES.md
|
|
descripcion: Requerimientos no funcionales
|
|
- path: docs/60-plan-desarrollo/PLAN-DESARROLLO.md
|
|
descripcion: Plan de desarrollo por fases
|
|
- path: docs/60-plan-desarrollo/INFERENCE-ENGINE-GAP-ANALYSIS.md
|
|
descripcion: Analisis de gaps del Inference Engine
|
|
- path: docs/60-plan-desarrollo/FASE-2-MCP-TOOLS-DESIGN.md
|
|
descripcion: Diseno de Fase 2 MCP Tools
|
|
- path: docs/80-referencias/API-REFERENCE.md
|
|
descripcion: Referencia de API
|
|
- path: docs/90-adr/ADR-001-runtime-selection.md
|
|
descripcion: ADR - Seleccion de runtime
|
|
- path: docs/90-adr/ADR-002-model-selection.md
|
|
descripcion: ADR - Seleccion de modelo
|
|
- path: docs/60-plan-desarrollo/INTEGRATION-TEST-RESULTS.md
|
|
descripcion: Resultados de tests de integracion MCP
|
|
|
|
fases:
|
|
fase_1_mvp:
|
|
status: completado
|
|
completitud: 95%
|
|
objetivo: Gateway basico + Ollama
|
|
entregables:
|
|
- Gateway NestJS (95%) # Build OK, Lint OK, todos endpoints mapeados
|
|
- Inference Engine Python (95%) # P0 gaps resueltos, 44 tests pasando
|
|
- Docker setup (95%) # Probado exitosamente con Ollama + tinyllama
|
|
- Documentacion (100%)
|
|
validaciones:
|
|
- build: PASS
|
|
- lint: PASS
|
|
- tests: 44/44 PASS
|
|
- endpoints: 8 endpoints mapeados
|
|
gaps_p0_resueltos:
|
|
- GAP-10.1: ENV validation con pydantic-settings
|
|
- GAP-2.1: Input validation en OllamaBackend
|
|
- GAP-2.2: Error codes especificos
|
|
- GAP-4.1: Pydantic constraints en Chat Route
|
|
- GAP-4.2: Error response formato OpenAI
|
|
- GAP-5.1: Cache 60s para models
|
|
- GAP-5.2: Fix MODEL_NAME → OLLAMA_MODEL
|
|
- GAP-6.1: Health response formato RF-GW-003
|
|
- GAP-6.2: Verificacion directa de Ollama
|
|
- GAP-7.1: Global exception handlers
|
|
- GAP-1.1: Retry mechanism con backoff
|
|
- GAP-8.1: Tests unitarios completos
|
|
- GAP-8.2: Mocking con fixtures pytest
|
|
|
|
fase_2_multi_tool:
|
|
status: completado
|
|
completitud: 100%
|
|
objetivo: MCP Tools + Tier Router
|
|
entregables:
|
|
- MCP Tools Module (100%) # classify, extract, rewrite, summarize
|
|
- Tier Classification (100%) # small/main tiers con router
|
|
- Rate Limiting (100%) # @nestjs/throttler + TierAwareThrottlerGuard
|
|
validaciones:
|
|
- build: PASS
|
|
- lint: PASS
|
|
- tests: 54/54 PASS (Gateway)
|
|
- integration: 5/5 endpoints probados con Docker
|
|
componentes_implementados:
|
|
- RateLimiterModule con ThrottlerModule async
|
|
- TierAwareThrottlerGuard (tier-based rate limits)
|
|
- McpThrottlerGuard (small tier default)
|
|
- X-RateLimit-* headers en responses
|
|
- Integration test documentation
|
|
|
|
fase_3_produccion:
|
|
status: futuro
|
|
completitud: 0%
|
|
objetivo: vLLM + Multi-LoRA
|