Minimalist, Privacy-First, Local AI-Powered LaTeX Editor & Live Compiler
TeXa is a modern, distraction-free LaTeX editor powered by local, on-device generative AI. Built with high performance and privacy in mind, TeXa allows you to compose documents, generate complex mathematical templates, diagnose compiler errors, and preview live-rendered PDFsβall without sending a single line of your code or research data to external cloud APIs.
Whether you are writing academic papers, mathematical proofs, resumes, or lecture slides, TeXa combines the power of open-weight Large Language Models with the speed of hybrid LaTeX compilation.
-
π§ Zero-Cloud Local AI Inference
- Runs Hugging Face models locally using PyTorch with full hardware acceleration:
- β‘ Apple Silicon (MPS) for M1/M2/M3/M4 Macs.
- π NVIDIA CUDA for GeForce/RTX/Tesla GPUs.
- βοΈ Optimized Multi-Threaded CPU fallback.
- Supports popular lightweight architectures like Qwen 2.5 Coder (1.5B / 3B / 7B), Google Gemma 3 (1B / 4B), Llama 3.2, or any custom CausalLM from Hugging Face Hub.
- Runs Hugging Face models locally using PyTorch with full hardware acceleration:
-
β‘ Hybrid LaTeX Compilation & Instant PDF Viewer
- Works with Tectonic (automatic on-the-fly package fetching), latexmk, or pdflatex.
- Includes continuous validation that compiles your documents as you write.
- Integrated full-featured PDF viewer with page navigation, zoom, and fit modes.
-
π AI Code & Template Generation
- Dedicated prompt-to-LaTeX generator with active document context awareness.
- Instantly produces clean code for tables (
booktabs), mathematical systems, TikZ flowcharts, and full document boilerplate. - Guardrailed to ensure clean, strictly compilation-ready LaTeX.
-
π οΈ Autonomous Compiler Diagnostic & Error Resolver
- Automatically parses compilation logs and identifies the exact file and line number causing the issue.
- Preprocesses line-numbered snippets and delivers root-cause explanations with 1-click copyable fixes.
-
π» VS Code-Grade Monaco Editor
- Full syntax highlighting for LaTeX and TeX macros.
- Integrated error squiggles and diagnostic markers.
- Multi-tab document navigation with unsaved change badges and clean indentation.
-
π Project Workspace & File Management
- Nested directory tree navigation with file and folder creation, deletion, and renaming.
- Configurable custom project directories.
-
π¨ Minimalist Dark & Light Themes
- Fully responsive, sleek UI with customizable dark and light modes.
Before installing TeXa, ensure you have the following prerequisites installed on your system:
| Tool | Minimum Version | Description |
|---|---|---|
| Python | 3.10+ |
Backend server, API, and PyTorch AI engine |
| Node.js & npm | 18.0+ |
Frontend web interface and Vite asset pipeline |
| LaTeX Engine | Any | Tectonic (Highly Recommended), TeX Live, MacTeX, or MiKTeX |
| Git | 2.0+ |
Version control for cloning and updates |
Follow the instructions below for your operating system:
-
Install Prerequisites via Homebrew (if not already installed):
brew install python node tectonic git
-
Clone the Repository:
git clone https://github.com/K-692/TeXa.git cd TeXa -
Set Up Python Virtual Environment:
python3 -m venv venv source venv/bin/activate -
Install Python Dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Install Frontend Dependencies & Build Assets:
cd frontend npm install npm run build cd ..
-
Launch TeXa:
python run.py
TeXa will start the backend server and automatically open
http://localhost:8000in your default browser.
-
Install Prerequisites via Winget or manual installers:
winget install Python.Python.3.11 winget install OpenJS.NodeJS.LTS winget install Git.Git winget install TectonicTypesetting.Tectonic(Alternative LaTeX: MiKTeX)
-
Clone the Repository:
git clone https://github.com/K-692/TeXa.git cd TeXa
-
Set Up Python Virtual Environment:
python -m venv venv .\venv\Scripts\Activate.ps1 -
Install Python Dependencies:
python -m pip install --upgrade pip pip install -r requirements.txt
-
Install Frontend Dependencies & Build Assets:
cd frontend npm install npm run build cd ..
-
Launch TeXa:
python run.py
-
Install Prerequisites:
- Ubuntu / Debian:
sudo apt update sudo apt install -y python3 python3-venv python3-pip nodejs npm git # Install Tectonic (recommended fast standalone compiler) sudo apt install -y tectonic || curl --proto '=https' --tlsv1.2 -fsSL https://drop-sh.fullyjustified.net | sh
- Fedora:
sudo dnf install -y python3 python3-pip nodejs git tectonic
- Arch Linux:
sudo pacman -S python python-pip nodejs npm git tectonic
- Ubuntu / Debian:
-
Clone the Repository:
git clone https://github.com/K-692/TeXa.git cd TeXa -
Set Up Python Virtual Environment:
python3 -m venv venv source venv/bin/activate -
Install Python Dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Install Frontend Dependencies & Build Assets:
cd frontend npm install npm run build cd ..
-
Launch TeXa:
python run.py
TeXa comes with an environment configuration file: .env.
# Hugging Face Access Token
# Required only for gated models (e.g. google/gemma-3-1b-it, meta-llama/Llama-3.2-3B-Instruct)
# Create a free read token at: https://huggingface.co/settings/tokens
HF_TOKEN=
# Default LaTeX Workspace Directory
# Can be a relative path (./projects) or an absolute directory (~/TeXa_Projects)
WORKING_DIRECTORY=./projectsTip: You can also configure your Hugging Face Token, selected model, and project directory directly within the TeXa user interface via the Settings (βοΈ) modal.
TeXa supports any Hugging Face CausalLM model. For best performance on personal laptops and desktops:
| Model ID | VRAM / RAM | Description |
|---|---|---|
Qwen/Qwen2.5-Coder-1.5B-Instruct |
~3 GB | Ultra-fast, lightweight model ideal for quick syntax and equations. |
Qwen/Qwen2.5-Coder-3B-Instruct |
~5 GB | Recommended. Outstanding LaTeX syntax and table generation. |
google/gemma-3-1b-it |
~2.5 GB | Google's high-efficiency lightweight multimodal/text model.(Requires HF Token) |
meta-llama/Llama-3.2-3B-Instruct |
~5 GB | Versatile general assistance and document debugging.(Requires HF Token) |
Custom Model ID |
Variable | Enter any Hugging Face model identifier in the UI model picker. |
Downloaded weights are stored locally in the models/ directory for offline reuse.
TeXa/
βββ backend/ # FastAPI Application & AI Engines
β βββ main.py # REST & WebSocket API Endpoints
β βββ ai_engine.py # PyTorch / MPS / CUDA Model Inference & Prompts
β βββ latex_engine.py # Tectonic / Latexmk Compiler & Log Diagnostics
β βββ file_manager.py # Workspace File Tree & File I/O
β βββ config.py # Global State & .env Manager
βββ frontend/ # React + Vite Web Application
β βββ src/
β β βββ components/ # Monaco Editor, PDF Viewer, File Tree, AI Panel
β β βββ assets/ # Logo & Icons
β β βββ styles/ # CSS & Design System
β β βββ App.jsx # Main Application Layout
β βββ package.json # Node Dependencies
β βββ vite.config.js # Vite Configuration
βββ models/ # Local Hugging Face Models Cache (ignored in git)
βββ projects/ # Default LaTeX Workspace
β βββ main.tex # Starter LaTeX Document
βββ run.py # Single-Command Cross-Platform Launcher
βββ requirements.txt # Python Dependencies
βββ .env # Environment Variables Template
βββ README.md # Project Documentation
- Cmd / Ctrl + S : Save active document and trigger compilation.
- Cmd / Ctrl + B : Manual compile document to PDF.
- Continuous Validation: When enabled in Settings, TeXa compiles your document seamlessly in the background as you type.
We want TeXa to grow and evolve with the community. You do not need to be a developer or know Git to help make TeXa better!
If you encounter an issue, bug, or have an idea for a feature or workflow enhancement:
- Simply fill out our Google Form to state the problem, error, or bug, and describe how you want it to be fixed or improved.
- π Submit Feature Request / Bug Report (Google Form)
All community submissions are automatically organized in our live Google Sheet so contributors can easily see what users need most:
- Browse user-submitted ideas, feature requests, and bug reports.
- Note for Contributors: When you pick up and complete any update or fix, please add a comment in the Google Sheet to notify the community and keep the tracker up to date.
- π View Community Responses & Feature Tracker (Google Sheet)
Contributions, bug fixes, and feature implementations are warmly welcomed!
- Check the Community Feature Tracker (Google Sheet) or GitHub Issues to see what improvements users are requesting.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request and leave a comment on the corresponding row in the Google Sheet once merged!
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
