Engineering Principles

Architectural decisions and operational constraints governing local-chat.

Design Philosophy

Local-First Architecture

All data processing, inference, and storage occur exclusively on the local device. No external cloud APIs are used for core functionality, including inference, analytics, or telemetry. This constraint is non-negotiable and applies to user conversations, logs, metrics, model execution, and system analytics.

Privacy-Centric Approach

User data is treated as strictly private: no external telemetry, no background reporting, and no implicit data collection. Local metrics are permitted only for operational visibility and debugging, and must never leave the device.

Simplicity and Robustness

Engineering decisions favor simple, explicit designs with small dependency trees and predictable failure modes. Complex abstractions are avoided unless they demonstrably improve robustness. If a solution appears "clever", it is assumed to be incorrect until proven otherwise.

Minimalism and KISS Principle

Minimalism is a foundational constraint of the project, not an aesthetic preference. All components of local-chat are expected to remain as simple as possible, but no simpler. Design choices must favor the smallest viable solution that satisfies functional and operational requirements.

The KISS principle is applied systematically:

Complexity is treated as technical debt. Any increase in complexity must be justified by a clear, measurable improvement in robustness, reliability, or long-term operability.

Terminology and Naming

Role-Based Naming

System components and models are named according to their functional role (e.g., "speed-oriented", "quality-oriented") rather than false hierarchies or tiers.

Functional Clarity

Names must describe what a component does, not merely what it is. Ambiguous naming is discouraged.

System Architecture

Technology Stack

Architectural Patterns

Model Policy

Coding Standards

Backend (Python)

Frontend (JavaScript)

CSS

User Experience Constraints

Resource Guardrails

Operational Discipline

Benchmark Engineering Principles

Error Isolation Workflow

  1. Task-focused script: Create dedicated scripts that run a specific failing task/case to isolate the issue with minimal moving parts.
  2. Bypass app APIs: Use dedicated scripts that call Ollama directly, removing app-layer routes/middleware from the path.
  3. Raw CLI inspection: If needed, run Ollama via CLI and inspect raw model output to understand behavior (for example, hidden reasoning/thinking patterns).

Documentation Constraints

LLM Usage Philosophy

In practice, humans no longer hand-review every line of generated code. Humans define goals, constraints, and direction; LLMs propose solutions and generate code using the highest-probability approach given the prompt and available context. Failures are expected: prompts may be ambiguous, context windows may be incomplete, and generated code may be wrong or unstable. The human responsibility is to understand the technology, diagnose gaps, and iteratively guide the model toward the correct implementation.