How relmarrakchy/llm-lab works
LLM Lab is a browser-based environment for testing a LangChain agent: a user submits a chat message, the frontend records request details and sends the query to the NestJS API, which invokes the configured Ollama-backed agent and returns a reply. The frontend displays the conversation and an in-memory request log with status and latency summaries. The README documents the Ollama integration and prompt/model configuration; unsampled files are represented only where the tree or documentation supports their role.
Main entry points: page.tsx Chat App State · agents.controller.ts Chat Endpoint · agent.ts LangChain Agent · agents.module.ts Agents Module
Components 15
Chat Interface
- Chat App State
frontend/app/page.tsx - Chat Composer
frontend/app/components/ChatSection.tsx - Message Display
frontend/app/components/MessageBubble.tsx - Log Summary
frontend/app/components/LogsSection.tsx - Log Details
frontend/app/components/LogEntry.tsx
Backend API
- Chat Endpoint
backend/src/agents/agents.controller.ts - Chat Request DTO
backend/src/agents/dto/chat-agent.dto.ts - Agent Service
backend/src/agents/agents.service.ts - Root Module
backend/src/app.module.ts - Agents Module
backend/src/agents/agents.module.ts
Agent Inference
- LangChain Agent
backend/src/agents/blueprint/agent.ts - Model Selection
backend/src/agents/blueprint/config.ts - System Prompt
backend/src/agents/blueprint/prompts/system.md
Other components
- User
- Ollama Model
Connections 18
- User → Chat Composer: submits query
README.md - Chat App State → Chat Composer: renders
frontend/app/page.tsx - Chat App State → Log Summary: renders logs
frontend/app/page.tsx - Chat Composer → Chat App State: sends input
frontend/app/page.tsx - Chat App State → Chat Endpoint: posts query
frontend/app/page.tsx - Chat Endpoint → Chat Request DTO: accepts body
backend/src/agents/agents.controller.ts - Chat Endpoint → Agent Service: invokes
backend/src/agents/agents.controller.ts - Agent Service → LangChain Agent: invokes
backend/src/agents/agents.service.ts - LangChain Agent → Model Selection: uses model
backend/src/agents/blueprint/agent.ts - LangChain Agent → System Prompt: loads prompt
backend/src/agents/blueprint/agent.ts - LangChain Agent → Ollama Model: runs inference
README.md - Root Module → Agents Module: imports
backend/src/app.module.ts - Agents Module → Chat Endpoint: registers
backend/src/agents/agents.module.ts - Agents Module → Agent Service: provides
backend/src/agents/agents.module.ts - Chat App State → Message Display: displays replies
- Log Summary → Log Details: renders entries
frontend/app/components/LogsSection.tsx - Chat Endpoint → Chat App State: returns response
README.md - Chat App State → Log Summary: records status and latency
frontend/app/page.tsx