Skip to content

ctex-ai/PigTex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PigTex logo

PigTex Desktop

Desktop AI workstation for focused chat, workspace memory, secure credentials, and release-grade Windows delivery.

Electron + React renderer, FastAPI backend, website-served desktop updates, and a public repository curated specifically for desktop contributors.

Latest release CI status MIT license Windows 10+ Electron 40 React 18 FastAPI backend

Download Latest Release · Contributing · Security · Trust Policy

TexAPI partner logo

Integrated partner: TexAPI is an API gateway provider that gives PigTex access to a broad model catalog through a single API key, with managed routing and BYOK-friendly endpoint control.

Important

This repository is the public desktop-only source tree for PigTex. It intentionally excludes the marketing website, deployment infrastructure, private prompt/data packs, local databases, packaged installers, and all real secrets.

Why PigTex

Workspace-aware memory
System rules and workspace rules can be kept separate so longer-running desktop work stays organized.
Flexible model routing
Connect through TexAPI or switch to direct providers with user-managed endpoints, models, and credentials.
Desktop-native release flow
Windows packaging, release staging, and production-safe desktop delivery are part of the public tree.
Privacy-conscious defaults
Secure local credential storage is used on supported platforms, and cloud backup remains opt-in.
Bilingual product surface
Core desktop flows are built for Vietnamese and English users instead of shipping placeholder localization.
Public-repo discipline
Community docs, release guards, and a curated file tree keep the repository presentable for external readers.

Product Tour

PigTex chat workflow demo Focused chat workflow
A desktop-first assistant surface built for longer sessions instead of throwaway prompts.
PigTex file workflow demo Workspace and file context
Local project context, editor flow, and structured desktop work stay inside one app.
PigTex endpoint configuration demo Endpoint and model control
Switch between TexAPI and direct providers with user-managed credentials and endpoints.
PigTex backup workflow demo Opt-in backup and sync
Cloud backup stays explicit, visible, and separate from local-first desktop usage.

Architecture

flowchart LR
    UI[React Renderer] --> IPC[Electron Main and Preload]
    IPC --> API[FastAPI Backend]
    API --> LOCAL[Local storage and workspace state]
    API --> CLOUD[Opt-in cloud backup and sync]
    IPC --> UPDATE[Website-served desktop updates]
    IPC --> SECURE[OS secure credential storage]
Loading

Quick Start

1. Install the renderer

npm ci
Copy-Item .env.example .env

2. Install the backend

cd backend
python -m venv venv
.\venv\Scripts\pip.exe install -r requirements.txt
Copy-Item .env.example .env

Use .env.example in the repository root for the renderer and backend/.env.example for the backend.

3. Run the core checks

npm run lint:security
npm test
npm run build:electron
cd backend
venv\Scripts\python.exe -m unittest discover -s tests -v

Release Workflow

Stable release builds target the production backend root. Before packaging, set:

$env:VITE_PIGTEX_API_BASE='https://pigtex.id.vn'

Then run:

npm run build:win:release
npm run release:stage
  • build:win:release creates the stable Windows installer in /release
  • release:stage stages the stable .exe and matching .blockmap for the production download host
  • Stable packaged builds check the hosted desktop manifest and open the website download flow when a newer installer is available

Repository Layout

Path Purpose
src/ React renderer UI and desktop-facing frontend logic
electron/ Electron main-process and preload code
backend/ FastAPI backend used by the desktop app
assets/ Source-managed logos and desktop assets
public/ Public runtime assets served by Vite
scripts/build/ Packaging helpers, RCEdit utilities, and build guards
scripts/release/ Release staging, validation, and GitHub publish helpers
scripts/signing/ Windows signing hooks and GA signing validation
scripts/dev/ Local development launch helpers
docs/ Public-safe trust and contributor-facing documentation

Public Repo Scope

This repository includes:

  • Electron renderer and main-process code
  • FastAPI backend used by the desktop app
  • Public-safe docs, tests, build configs, and example environment files

This repository does not include:

  • Website and download-manifest source
  • deploy/, ops/, or other private infrastructure material
  • Real .env files, local databases, logs, node_modules, or packaged installers
  • Private prompt/data packs and internal operating material
Optional private prompt packs

This public repo can run without the private prompt/data packs. If you keep those packs outside the repo, point the backend at them with:

PIGTEX_DATA_DIR=
PIGTEX_PROMPT_PACKS_DIR=
PIGTEX_SKILL_FOUNDRY_DIR=
  • PIGTEX_DATA_DIR or PIGTEX_PROMPT_PACKS_DIR: external directory that contains system_prompts/, enhancement_rules/, and related JSON packs
  • PIGTEX_SKILL_FOUNDRY_DIR: external prompt-catalog storage directory

If these variables are not set, the backend degrades safely and uses local per-device storage where needed.

Community and Trust

License

Licensed under MIT.

About

Visit our website to experience the benefits we offer.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors