# alvaritoo89/locall architecture

> Architecture diagram of the GitHub repository alvaritoo89/locall, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alvaritoo89/locall
- Repository: https://github.com/alvaritoo89/locall

## Overview

Locall is a Spanish-language, local-first AI model manager and inference platform. Users discover compatible models, install or import them, then chat through the CLI, desktop app, or local API; models and conversations remain on the machine. The API mediates client requests to the Rust core, which coordinates model storage, registry, scheduling, and inference. The README also describes signed model catalogs and a website. Some subsystem links below are based on README-level architecture because their implementation excerpts were not sampled.

Main entry points: [`crates/locall-core/src/lib.rs`](https://github.com/alvaritoo89/locall/blob/main/crates/locall-core/src/lib.rs) (Core service), [`crates/locall-api/src/lib.rs`](https://github.com/alvaritoo89/locall/blob/main/crates/locall-api/src/lib.rs) (Local API), [`crates/locall-scheduler/src/lib.rs`](https://github.com/alvaritoo89/locall/blob/main/crates/locall-scheduler/src/lib.rs) (Model scheduler), [`crates/locall-app/src/main.rs`](https://github.com/alvaritoo89/locall/blob/main/crates/locall-app/src/main.rs) (Desktop bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_desktop["Desktop bridge<br/>[main.rs]"]
  node_ui["Desktop UI<br/>[App.tsx]"]
  node_cli["CLI<br/>[ordenes.rs]"]
end

subgraph group_service["Local service"]
  node_local_api["Local API<br/>[lib.rs]"]
  node_core["Core service<br/>[lib.rs]"]
  node_config["Settings and logs<br/>[lib.rs]"]
end

subgraph group_models["Model lifecycle"]
  node_catalog["Signed catalog<br/>[lib.rs]"]
  node_hf["Hugging Face discovery<br/>[huggingface.rs]"]
  node_compat["Compatibility checks<br/>[lib.rs]"]
  node_gguf["GGUF reader<br/>[lib.rs]"]
  node_downloads["Verified downloads<br/>[lib.rs]"]
  node_store[("Model store<br/>[lib.rs]")]
  node_registry[("Model and chat registry<br/>[lib.rs]")]
end

subgraph group_runtime["Inference runtime"]
  node_scheduler["Model scheduler<br/>[lib.rs]"]
  node_engine["Inference engine control<br/>[lib.rs]"]
  node_system["Machine and process support<br/>[lib.rs]"]
end

node_user(("User"))
node_llama["llama.cpp process"]
node_website["Project website<br/>[lib.rs]"]

node_user -->|"uses"| node_desktop
node_user -->|"uses"| node_cli
node_user -->|"uses"| node_local_api
node_ui -->|"invokes"| node_desktop
node_desktop -->|"requests"| node_local_api
node_cli -->|"requests"| node_local_api
node_local_api -->|"delegates to"| node_core
node_core -->|"opens"| node_config
node_core -.->|"uses"| node_catalog
node_core -->|"discovers models"| node_hf
node_core -->|"checks fit"| node_compat
node_core -->|"reads headers"| node_gguf
node_core -.->|"downloads models"| node_downloads
node_core -.->|"manages files"| node_store
node_core -->|"records models and chats"| node_registry
node_core -.->|"requests model use"| node_scheduler
node_scheduler -->|"starts and stops"| node_engine
node_engine -->|"controls process"| node_llama
node_scheduler -->|"checks memory"| node_system
node_user -->|"visits"| node_website

click node_desktop "https://github.com/alvaritoo89/locall/blob/main/crates/locall-app/src/main.rs"
click node_ui "https://github.com/alvaritoo89/locall/blob/main/crates/locall-app/ui/src/App.tsx"
click node_cli "https://github.com/alvaritoo89/locall/blob/main/crates/locall-cli/src/ordenes.rs"
click node_local_api "https://github.com/alvaritoo89/locall/blob/main/crates/locall-api/src/lib.rs"
click node_core "https://github.com/alvaritoo89/locall/blob/main/crates/locall-core/src/lib.rs"
click node_config "https://github.com/alvaritoo89/locall/blob/main/crates/locall-config/src/lib.rs"
click node_catalog "https://github.com/alvaritoo89/locall/blob/main/crates/locall-catalogo/src/lib.rs"
click node_hf "https://github.com/alvaritoo89/locall/blob/main/crates/locall-core/src/huggingface.rs"
click node_compat "https://github.com/alvaritoo89/locall/blob/main/crates/locall-compat/src/lib.rs"
click node_gguf "https://github.com/alvaritoo89/locall/blob/main/crates/locall-gguf/src/lib.rs"
click node_downloads "https://github.com/alvaritoo89/locall/blob/main/crates/locall-download/src/lib.rs"
click node_store "https://github.com/alvaritoo89/locall/blob/main/crates/locall-store/src/lib.rs"
click node_registry "https://github.com/alvaritoo89/locall/blob/main/crates/locall-registry/src/lib.rs"
click node_scheduler "https://github.com/alvaritoo89/locall/blob/main/crates/locall-scheduler/src/lib.rs"
click node_engine "https://github.com/alvaritoo89/locall/blob/main/crates/locall-engine/src/lib.rs"
click node_system "https://github.com/alvaritoo89/locall/blob/main/crates/locall-system/src/lib.rs"
click node_website "https://github.com/alvaritoo89/locall/blob/main/crates/locall-web/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop,node_ui,node_cli,node_user toneBlue
class node_local_api,node_core,node_config toneAmber
class node_catalog,node_hf,node_compat,node_gguf,node_downloads,node_store,node_registry toneMint
class node_scheduler,node_engine,node_system toneRose
class node_llama toneIndigo
class node_website toneTeal
```

## Components

### User clients

- [Desktop bridge](https://github.com/alvaritoo89/locall/blob/main/crates/locall-app/src/main.rs): `crates/locall-app/src/main.rs`
- [Desktop UI](https://github.com/alvaritoo89/locall/blob/main/crates/locall-app/ui/src/App.tsx): `crates/locall-app/ui/src/App.tsx`
- [CLI](https://github.com/alvaritoo89/locall/blob/main/crates/locall-cli/src/ordenes.rs): `crates/locall-cli/src/ordenes.rs`

### Local service

- [Local API](https://github.com/alvaritoo89/locall/blob/main/crates/locall-api/src/lib.rs): `crates/locall-api/src/lib.rs`
- [Core service](https://github.com/alvaritoo89/locall/blob/main/crates/locall-core/src/lib.rs): `crates/locall-core/src/lib.rs`
- [Settings and logs](https://github.com/alvaritoo89/locall/blob/main/crates/locall-config/src/lib.rs): `crates/locall-config/src/lib.rs`

### Model lifecycle

- [Signed catalog](https://github.com/alvaritoo89/locall/blob/main/crates/locall-catalogo/src/lib.rs): `crates/locall-catalogo/src/lib.rs`
- [Hugging Face discovery](https://github.com/alvaritoo89/locall/blob/main/crates/locall-core/src/huggingface.rs): `crates/locall-core/src/huggingface.rs`
- [Compatibility checks](https://github.com/alvaritoo89/locall/blob/main/crates/locall-compat/src/lib.rs): `crates/locall-compat/src/lib.rs`
- [GGUF reader](https://github.com/alvaritoo89/locall/blob/main/crates/locall-gguf/src/lib.rs): `crates/locall-gguf/src/lib.rs`
- [Verified downloads](https://github.com/alvaritoo89/locall/blob/main/crates/locall-download/src/lib.rs): `crates/locall-download/src/lib.rs`
- [Model store](https://github.com/alvaritoo89/locall/blob/main/crates/locall-store/src/lib.rs): `crates/locall-store/src/lib.rs`
- [Model and chat registry](https://github.com/alvaritoo89/locall/blob/main/crates/locall-registry/src/lib.rs): `crates/locall-registry/src/lib.rs`

### Inference runtime

- [Model scheduler](https://github.com/alvaritoo89/locall/blob/main/crates/locall-scheduler/src/lib.rs): `crates/locall-scheduler/src/lib.rs`
- [Inference engine control](https://github.com/alvaritoo89/locall/blob/main/crates/locall-engine/src/lib.rs): `crates/locall-engine/src/lib.rs`
- [Machine and process support](https://github.com/alvaritoo89/locall/blob/main/crates/locall-system/src/lib.rs): `crates/locall-system/src/lib.rs`

### Other components

- **User**
- **llama.cpp process**
- [Project website](https://github.com/alvaritoo89/locall/blob/main/crates/locall-web/src/lib.rs): `crates/locall-web/src/lib.rs`

## Connections

- User → Desktop bridge: uses
- User → CLI: uses
- User → Local API: uses
- Desktop UI → Desktop bridge: invokes (evidence: `crates/locall-app/src/main.rs`)
- Desktop bridge → Local API: requests (evidence: `crates/locall-app/src/main.rs`)
- CLI → Local API: requests
- Local API → Core service: delegates to (evidence: `crates/locall-api/src/lib.rs`)
- Core service → Settings and logs: opens (evidence: `crates/locall-core/src/lib.rs`)
- Core service → Signed catalog: uses
- Core service → Hugging Face discovery: discovers models (evidence: `crates/locall-core/src/lib.rs`)
- Core service → Compatibility checks: checks fit (evidence: `crates/locall-core/src/lib.rs`)
- Core service → GGUF reader: reads headers (evidence: `crates/locall-core/src/lib.rs`)
- Core service → Verified downloads: downloads models
- Core service → Model store: manages files
- Core service → Model and chat registry: records models and chats (evidence: `crates/locall-core/src/lib.rs`)
- Core service → Model scheduler: requests model use
- Model scheduler → Inference engine control: starts and stops (evidence: `crates/locall-scheduler/src/lib.rs`)
- Inference engine control → llama.cpp process: controls process
- Model scheduler → Machine and process support: checks memory (evidence: `crates/locall-scheduler/src/lib.rs`)
- User → Project website: visits
