$ show ParisNeo/lollms-webui
LoLLMs (Lord of Large Language Multimodal Systems) is a local, single-user web application for interacting with large language models. It provides a FastAPI + Socket.IO backend with a Vue.js frontend, supporting multiple model backends (bindings) such as llama.cpp, OpenAI, Anthropic, and Ollama. The system features a plugin architecture with 'personalities' (scripted AI agents), function calling, RAG capabilities, and services for text-to-image, text-to-speech, and text-to-video. It is designed for extensibility through zoos of bindings, personalities, services, and functions. While primarily an application, it includes some data/research elements like model scrapers and training scripts, but these are secondary to the core chat interface.
The LLM identified 5 files worth highlighting for reuse:
Provides TypedConfig and ConfigTemplate classes for declarative, type-validated configuration with YAML persistence and UI hint generation. This pattern is used uniformly across all bindings, personalities, and services, and could be extracted for any Python project needing structured configuration.
Implements path sanitization (sanitize_path, sanitize_path_from_endpoint) and access control (check_access, forbid_remote_access) utilities. These functions are applied consistently across endpoints to prevent path traversal and restrict remote access. Reusable in any web application requiring similar security measures.
A safe arithmetic expression evaluator that uses Python's AST module to parse and evaluate mathematical expressions with a whitelist of allowed operations. It avoids the security risks of eval() while supporting basic math, constants, and functions. Reusable in any project needing safe math evaluation.
Renders Graphviz DOT language code to SVG by invoking the graphviz command-line tool and embedding the output in an HTML iframe. Part of a family of execution engines (mermaid, python, latex, etc.) that follow a consistent pattern for sandboxed code execution and rendering. Reusable for any web application needing to display Graphviz diagrams.
Implements SocketIOFile for transferring files over Socket.IO with base64 encoding and SHA256 hash verification. Provides methods for sending and receiving files with progress tracking and integrity validation. Reusable in any Socket.IO-based application requiring reliable file transfer.