THETA (θ)
English | 中文
THETA (θ) is a low-barrier, high-performance agent-native topic analysis platform for social science research.
[!IMPORTANT]
Version compatibility: future releases may introduce breaking changes. THETA is under active development. Configuration formats, project data structures, APIs, and workflows may change incompatibly, requiring migration or updates to existing projects, settings, or third-party integrations. Before upgrading, read the release notes and back up your complete project data directories, configuration, and important analysis results. Follow any migration instructions provided for that release.
Choose how to use THETA
Use the Web workbench, CLI Agent, or desktop app, with an optional Skill for other agents. This repository maintains the local edition: the workbench and compute services run on your computer, where projects and results are stored. You can configure your own cloud LLM and Embedding APIs.
| Entry point |
Best for |
Get started |
| Desktop · Mac / Windows |
Installing and using THETA without setting up a development environment |
Download an installer; Python and compute dependencies are bundled. No separate Python, Node.js, or Conda installation is needed |
| Web workbench |
Conversation and manual analysis in your browser |
Complete the source environment setup, run ./theta-web start, and open the local workbench |
| CLI Agent |
Conversational data analysis in your terminal |
Complete the Agent setup, then run ./theta |
You can also use the THETA Workflow Skill with a compatible agent to guide research and training.
Desktop downloads · 0.3.17 preview
From 0.3.8, use Settings → App updates for future downloads. Windows supports confirmed restart-to-install; the unsigned Mac preview downloads the DMG in the app. Earlier versions need one manual installation to enable this feature.
Windows automatically uses compatible NVIDIA GPUs, with CPU fallback. The first accelerated task downloads a verified GPU component (about 2.6 GiB); CPU-only computers do not need it. See the GPU setup details.
The desktop app bundles the Web interface. Source updates take effect after ./theta-web restart; installed apps need an application update to receive the same changes. Current desktop installers retain projects and settings; consult the corresponding release notes for data compatibility and migration requirements in future versions.
On Mac, open the DMG and drag THETA into Applications. On Windows, run the EXE installer. Open Settings in the app to enter your model API endpoint and key, and choose local or cloud embeddings. No user credentials or model weights are bundled. The default local embedding model is Qwen3-Embedding-0.6B; the cloud preset is GLM embedding-3. Traditional models such as LDA do not require neural model weights.
This desktop release is a preview without official signing/notarization, so the operating system may show a security warning. Native Intel Mac and Windows ARM installers are not provided. See the desktop guide and release notes with SHA-256 checksums.
Start the Web Workbench (Conversation / Manual)
Run from the repository root on macOS / Linux for local development:
./theta-web start # Build, check, and start the frontend and both APIs in the background
./theta-web status # Show service health, logs, and data directories
./theta-web restart # Rebuild and restart after updating code
./theta-web stop # Stop web services; keep projects and training results
./theta-web check # Build and check the Worker without starting training
Open http://127.0.0.1:4320/workbench?mode=conversation and switch between Conversation and Manual at the top. Closing the terminal does not stop the services; run ./theta-web start again after rebooting your computer.
First-time setup requires Node.js ≥ 22.13, pnpm, the Python compute environment, and private agent/.env.local configuration (Agent setup). Install dependencies once:
pnpm --dir agent install --frozen-lockfile
npm --prefix frontend ci
The launcher uses frontend/, the conversation API on 4318, and the manual API on 4321, preserving existing data in .theta_agent/ and .local/manual-workbench/. No legacy services are required. Do not delete these data directories or overwrite existing .env.local files. Logs are in .local/workbench/. Port conflicts are reported without killing unrelated processes.
Conversation mode preserves original data and saves derived files, preprocessing code, and validation reports before asking you to confirm training. Removing an attachment reference from the composer does not delete project data; sent-message counts are stored with the conversation.
This is a local development entry point, not an unauthenticated production deployment. See web setup and troubleshooting for details. The independent CLI remains ./theta.
For THETA zero-shot analysis, choose local or cloud embeddings before confirming training. The confirmation card identifies the cloud service, data scope, and request budget. CTM and BERTopic also support local or cloud embeddings. THETA fine-tuning requires compatible local model weights.
Conversation and manual modes share the training configuration dialog. Review the proposed models, data columns, and parameters before starting. Multiple models run sequentially and retain separate results. Draft settings and confirmed queues persist across refreshes without submitting duplicate tasks.
Shared Web and desktop workflow
Cloud compute: coming soon. Local Agent, selectable compute. Settings → Compute defaults to the local worker. Configure a THETA Worker v1 compatible API URL, key, and per-experiment cost limit to run training remotely in both conversation and manual modes. Projects, Agent orchestration, and conversations remain local. Selected training data is uploaded only after confirmation; progress, split results, charts, and downloads return to the local project. See the remote worker integration contract.
The Web workbench and desktop app use the same interface and Worker APIs for training, progress, and results. Upload individual files or a whole folder, combine selected files, remove uploaded source files, or replace data within the current project. Large uploads show a processing-time notice. LDA is the recommended default; THETA is marked as experimental. You can clear model selections while editing, but must select at least one before starting. A failed model retains its own error while other ready models continue.
Optional dataset splitting supports adjustable training, validation, and test proportions, random or sequential splitting, and separately uploaded datasets. Results provide separate metrics and visualizations for the full dataset and each split. Without custom splitting, training and validation use 70% / 30%, and testing uses all data, including the training data. The full-data test is not an independent holdout evaluation.
In conversation mode, manage imported or downloaded skills alongside the built-in visualization skill. Completed manual results can be copied into a conversation for further interpretation. Request the full analysis report from the results page to generate Markdown and PDF asynchronously; it is not generated until requested.
In local Web Settings → Model API, enter your endpoint, model, and key, then click Done to save. Keys are encrypted locally and remain masked; leaving the field blank preserves an existing key. The desktop app also provides Embedding model settings. Source Web and CLI users configure embedding endpoints and local model paths in private agent/.env.local as described in the Agent guide.
Feature consistency does not imply automatic data synchronization between installations. Web defaults to .theta_agent/ and .local/manual-workbench/; the desktop uses its own data directory. Use the same service and storage to access the same projects; separate computers do not automatically share projects or credentials.
See the help website for usage instructions. For bugs, open a GitHub issue or email duanzhenke@code-soul.com.
The engine quickstart below is for source users. Desktop users can install THETA directly from the downloads above.
Table of Contents
- Computation Engine Setup
- Agent Workflow Skill: THETA Workflow
- Data Format Requirements
- Configuration System: From Hardware to Experiments
- Running Modes: Beginner vs Expert
- Output Map: Where Are the Results?
- Scientific Evaluation Standards
- Supported Models
- Training Parameters Reference
- FAQ
Computation Engine Setup
Step 1: Clone Repository
git clone https://github.com/CodeSoul-co/THETA.git
cd THETA
Step 2: Environment Isolation (Conda)
conda create -n theta python=3.10 -y
conda activate theta
Step 3: Install Dependencies + Download Models
bash scripts/env_setup.sh
Step 4: Configure Environment Variables
# Copy configuration template
cp .env.example .env
# Edit .env file to configure model paths
# At minimum, configure: QWEN_MODEL_0_6B and SBERT_MODEL_PATH
Step 5: Load Environment Variables
# If you encounter "$'\r': command not found" error, fix Windows line endings first
sed -i 's/\r$//' scripts/env_setup.sh
# Load environment variables to current shell (required for subsequent scripts)
source scripts/env_setup.sh
Model Download Links:
| Model |
Purpose |
Download Link |
| Qwen3-Embedding-0.6B |
THETA document embedding |
ModelScope |
| all-MiniLM-L6-v2 |
CTM/SBERT embedding |
HuggingFace |
Place downloaded models in the models/ directory:
models/
├── qwen3_embedding_0.6B/
└── sbert/sentence-transformers/all-MiniLM-L6-v2/
Automatic Model Download
THETA supports automatic detection and download of missing model weight files during training.
Automatic Download (Recommended): Simply run the training command, and the system will automatically detect and download missing models:
# CTM/BERTopic training - auto-download SBERT
bash scripts/train_baseline.sh ctm --dataset your_dataset --num_topics 20
# THETA training - auto-download Qwen
bash scripts/train_theta.sh --dataset your_dataset --model_size 0.6B
Note: The first run may take a few minutes to download models. If automatic download fails due to network issues, please manually download from the links above.
Agent Workflow Skill: THETA Workflow
This repository includes a portable agent workflow skill at skills/theta-workflow/. A standalone public copy is published at CodeSoul-co/theta-skill