Files
ForgeLM/.planning/codebase/STACK.md
T

5.3 KiB

Technology Stack

Analysis Date: 2026-03-28

Languages

Primary:

  • Rust 2021 - core backend, inference runtime, CLI, shared contracts, metrics, and Tauri desktop backend in Cargo.toml, crates/inference-server/src/main.rs, crates/inference-core/src/engine.rs, crates/localllm-cli/src/main.rs, and tauri-app/src-tauri/src/lib.rs
  • TypeScript 5.5 - desktop frontend, runtime manager UI, chat UI, and tests in tauri-app/package.json, tauri-app/src/App.tsx, and tauri-app/src/features/runtime/components/RuntimeSettingsDrawer.tsx

Secondary:

  • CSS - hand-authored styling with app-wide tokens and feature CSS modules in tauri-app/src/index.css, tauri-app/src/components/Sidebar.css, and tauri-app/src/components/ChatView.css
  • Markdown - product and architecture docs in README.MD, docs/api/overview.md, and docs/app/overview.md
  • Python - benchmark and experiment scripts in experiments/bench_chat_latency.py, experiments/bench_cli_surface.py, and related files under experiments/

Runtime

Environment:

  • Rust toolchain targeting native desktop/server binaries; no workspace-level rust-toolchain file detected
  • Node.js runtime for Vite/Tauri frontend workflows in tauri-app/package.json

Package Manager:

  • Cargo for Rust workspace dependencies and binaries in Cargo.toml
  • npm is the documented frontend package manager via README.MD:47; lockfiles for npm and pnpm are both present in tauri-app/package-lock.json and tauri-app/pnpm-lock.yaml
  • Lockfile: present for Rust and frontend in Cargo.lock and tauri-app/package-lock.json

Frameworks

Core:

  • Axum 0.8 - local HTTP API in Cargo.toml and crates/inference-server/src/routes.rs
  • React 18 - desktop UI shell and chat surface in tauri-app/package.json and tauri-app/src/App.tsx
  • Tauri 2 - desktop shell, local process control, file dialogs, and frontend-to-Rust command bridge in tauri-app/src-tauri/Cargo.toml and tauri-app/src-tauri/src/lib.rs
  • llama.cpp FFI via custom llama-sys - model loading and token generation in crates/inference-core/src/engine.rs and crates/inference-core/src/session.rs

Testing:

  • Vitest 4 - frontend/unit/component tests in tauri-app/package.json and tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx
  • Rust built-in test harness - backend/unit tests co-located in files such as crates/api-contracts/src/chat.rs and tauri-app/src-tauri/src/runtime/state.rs

Build/Dev:

  • Vite 5 - frontend dev/build tool in tauri-app/vite.config.ts
  • TypeScript compiler - typecheck step in tauri-app/package.json:9
  • Tauri CLI 2 - desktop dev/build entry in tauri-app/package.json:11

Key Dependencies

Critical:

  • tokio - async runtime for API server in Cargo.toml and crates/inference-server/src/main.rs
  • tower-http - CORS and trace middleware in Cargo.toml and crates/inference-server/src/compat.rs
  • serde / serde_json - shared request/response contracts across API, CLI, and Tauri in crates/api-contracts/src/chat.rs and tauri-app/src-tauri/src/runtime/config.rs
  • clap - CLI command surface in crates/localllm-cli/src/main.rs
  • ureq - synchronous HTTP transport for CLI live execution in crates/localllm-cli/src/main.rs:404
  • marked, dompurify, highlight.js - markdown rendering/sanitization/code highlighting in tauri-app/src/lib/markdown.ts
  • @tauri-apps/api and @tauri-apps/plugin-shell - frontend/Tauri bridge in tauri-app/package.json and tauri-app/src/features/runtime/api.ts

Infrastructure:

  • uuid - response IDs for chat completions in crates/inference-server/src/routes.rs:126
  • tracing and tracing-subscriber - backend logging and startup diagnostics in crates/inference-server/src/main.rs
  • async-stream - SSE streaming implementation in crates/inference-server/Cargo.toml and crates/inference-server/src/routes.rs:137

Configuration

Environment:

  • Backend runtime is environment-driven via LOCALLLM_MODEL, LOCALLLM_PROFILE, LOCALLLM_ADDR, LOCALLLM_GPU_LAYERS, LOCALLLM_CTX, LOCALLLM_API_KEY, LOCALLLM_CORS_ORIGINS, LOCALLLM_AUTH_HEADER, LOCALLLM_AUTH_SCHEME, LOCALLLM_SYSTEM_PROMPT, and LOCALLLM_MODEL_ALIASES in crates/inference-server/src/main.rs and crates/inference-server/src/compat.rs
  • Desktop runtime config is persisted as JSON in the app data directory through tauri-app/src-tauri/src/runtime/config.rs
  • Frontend fallback runtime snapshot is persisted in localStorage through tauri-app/src/features/runtime/api.ts

Build:

  • Rust workspace build in Cargo.toml
  • Tauri desktop build in tauri-app/src-tauri/Cargo.toml and tauri-app/src-tauri/tauri.conf.json
  • Frontend dev server/build in tauri-app/vite.config.ts and tauri-app/package.json

Platform Requirements

Development:

  • Rust + Cargo for backend and desktop backend in README.MD:56
  • Node.js/npm for the Tauri frontend in README.MD:57
  • Local .gguf model for real inference in README.MD:58
  • Optional NVIDIA GPU for accelerated local runtime; CPU fallback profile exists in README.MD:59 and crates/inference-core/src/profile.rs

Production:

  • Local-first desktop deployment via Tauri app in tauri-app/
  • Local HTTP API deployment as standalone binary localllm in crates/inference-server/Cargo.toml:8

Stack analysis: 2026-03-28