How abuzar-ansarii/privatepixelprompt works
1. Overall shape
PortableLM is a cross-platform, portable local-AI package. The repository is mostly a set of OS-specific launch/install wrappers around one shared runtime and one shared web UI/server.
2. Platform boundary
The Windows, Linux, and Mac folders contain only thin entrypoint scripts:
- install/uninstall scripts
- start scripts
These are platform adapters; they do not appear to implement the AI logic themselves.
3. Shared runtime boundary
The Shared folder is the core of the architecture. It holds the cross-platform assets that are meant to be reused regardless of host OS:
- chat_server.py for the local service
- FastChatUI.html for the browser UI
- config/ for model and asset metadata
- scripts/ for setup, cleanup, and asset download helpers
4. Local server + browser UI
The main runtime appears to be a Python HTTP server (Shared/chat_server.py) that serves the UI and provides the local API for chat/image/TTS actions. The browser is the client, and the server listens locally by default on localhost:3333, with LAN access also supported for devices on the same network.
5. UI delivery
Shared/FastChatUI.html is the front-end entrypoint. The README indicates the UI is offline-capable and “network proxied,” so the browser page is likely delivered from the local server along with bundled assets rather than pulling from external CDNs.
6. Model and asset configuration
Shared/config/models.json is the key metadata boundary for what models are available and how they are presented/selected. ui-vendor-assets.json likely maps which vendor UI assets/fonts/scripts must be bundled locally to keep the interface fully offline.
7. Supporting scripts
Shared/scripts/ contains operational helpers:
- download-ui-assets.sh / .ps1 for fetching local UI dependencies
- config_query.py for reading/querying configuration state
- uninstall-common.sh for shared cleanup
This suggests the repo separates one-time provisioning from runtime execution.
8. Persistent data boundary
The README’s folder architecture shows persistent state lives under Shared as shared storage, including:
- chat history
- generated images
- TTS outputs
- downloaded models
This is the data plane that survives across OSes and across launches.
9. Engine boundary
The README describes packaged local engines for LLMs, image generation, and TTS; these are treated as isolated binaries under the shared storage concept. The repository’s scripts likely install and launch those engines, but the engines themselves are external payloads rather than source code in this tree.
10. Execution flow
Typical flow is:
- run the OS install script
- download/extract shared assets, models, and engine binaries
- launch the OS start script
- the Python server starts
- the browser opens to the local UI
- UI actions are routed to local model engines and results are written back into shared storage
11. Operational constraints
The architecture is explicitly offline-first and air-gapped after setup. There is no cloud service dependency in the repo structure; the main runtime boundary is between local browser clients and the local Python/server-plus-engine stack.
12. How to diagram it
A good architecture diagram should show:
- three OS-specific launcher boxes feeding into one shared runtime
- a Python local server in the middle
- browser clients on localhost and optional LAN devices
- shared persistence/config/model storage underneath
- local AI engines as separate binaries behind the server
Main entry points: chat_server.py Server · download-ui-assets.sh Asset setup · uninstall-common.sh Cleanup · Windows Windows
Components 14
Platform launchers
OS-specific install/start/uninstall wrappers
Shared runtime
Cross-platform server, UI, config, and support scripts
- Server · Local HTTP API and content server for chat, image, and TTS actions
Shared/chat_server.py - FastChat UI · Offline-capable front-end served locally
Shared/FastChatUI.html - Models · Available model metadata and presentation settings
Shared/config/models.json - UI assets · Vendor assets that must be bundled locally for offline UI delivery
Shared/config/ui-vendor-assets.json - Asset setup · Helpers that fetch UI dependencies and bootstrap local assets
Shared/scripts/download-ui-assets.sh - Config query · Reads and inspects shared configuration state
Shared/scripts/config_query.py - Cleanup · Shared removal and cleanup logic
Shared/scripts/uninstall-common.sh
Clients
Local browser access points
- Local browser · Primary user client loading the UI from localhost
- LAN devices · Optional devices on the same network reaching the local server
Local engines
Packaged AI runtimes and model backends
- AI engines · Packaged LLM, image, and TTS backends launched locally after setup
Persistent storage
Shared data and downloaded assets that survive launches
- Shared data · Chat history, generated media, models, and other durable runtime state
Connections 20
- Windows → Server: starts · Windows wrappers launch the shared runtime
- Linux → Server: starts · Linux wrappers launch the shared runtime
- Mac → Server: starts · macOS wrappers launch the shared runtime
- Server → FastChat UI: serves · Server delivers the browser UI and local API
- FastChat UI → Server: calls · UI sends chat and generation requests to the local server
- Local browser → FastChat UI: opens · Primary client loads the UI from localhost
- LAN devices → Server: reaches · Optional LAN clients can connect to the local service
- Server → Models: reads · Server uses model metadata to expose choices and capabilities
- Server → UI assets: reads · Server and setup logic rely on the offline asset manifest
- Asset setup → UI assets: uses · Provisioning scripts fetch and bundle declared assets
- Config query → Models: reads · Utility script inspects configuration state
- Cleanup → Shared data: cleans · Shared uninstall path removes persisted artifacts
- Server → Shared data: writes · Chat, image, and TTS outputs are persisted in shared storage
- Server → AI engines: invokes · Runtime dispatches requests to local AI engines
- Windows → Asset setup: provisions · Platform installers trigger shared setup steps
- Linux → Asset setup: provisions · Platform installers trigger shared setup steps
- Mac → Asset setup: provisions · Platform installers trigger shared setup steps
- Windows → Cleanup: uninstalls · Windows uninstall path reuses shared cleanup logic
- Linux → Cleanup: uninstalls · Linux uninstall path reuses shared cleanup logic
- Mac → Cleanup: uninstalls · macOS uninstall path reuses shared cleanup logic