Skip to content
프로젝트

소개

Open Source AI LaTeX Editor

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
-2
in 7 days
-2
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Octree Logo

Octree

AI-Powered LaTeX Editor

Write, edit, and compile LaTeX with AI assistance. Chat with Claude to generate documents,
get intelligent edit suggestions, and collaborate in real time.

Website • Quick Start • GitHub

framework language database AI license

What is Octree?

Octree is an AI-powered LaTeX editor that brings intelligent writing assistance to academic and technical document creation. Write LaTeX in a Monaco-based editor, chat with Claude for help, and compile to PDF — all in one place.

Getting Started

Prerequisites

  • Node.js 18+
  • Docker and the Supabase CLI for the local database, or a hosted Supabase project
  • Go 1.21+ and a TeX distribution with latexmk (e.g. MacTeX or TeX Live) for the compile service
  • A Stripe account (for billing)
  • A Claude API key (for AI features)

Setup

git clone https://github.com/octree-labs/octree.git
cd octree
npm install
npm install --prefix services/agent

Copy the example environment file and fill in your keys:

cp .env.example .env.local

The agent server reads services/agent/.env (see Hosting the agent server). The compile service needs no configuration locally.

Start everything from the repo root — local Supabase, then the Next.js app, agent server, and compile service in one terminal:

npm run dev:all
Service URL
Next.js app http://localhost:3000
Agent server http://localhost:8787
Compile service http://localhost:3001
Supabase API http://localhost:54321

Supabase and the agent server are required for auth and AI features. The compile service is only needed for PDF compilation. To use a hosted Supabase project instead of the local stack, point the Supabase variables in .env.local at your project; supabase start then isn't needed, so run the services individually (npm run dev, npm --prefix services/agent run dev, make -C services/compile run).

Commands

Command Description
npm run dev:all Start local Supabase, the Next.js app, agent server, and compile service
npm run dev Start the Next.js dev server only (Turbopack)
npm run build Production build
npm run lint Run ESLint
npm run test Run all tests (Vitest)
npm run test:watch Watch mode
npm run resume:redesign -- <resume.pdf> Run the resume redesign pipeline locally (needs ANTHROPIC_API_KEY and latexmk)

Tech Stack

Layer Technology
Framework Next.js 15 (App Router)
Language TypeScript (strict mode)
UI React 19, shadcn/ui, Tailwind CSS
Editor Monaco Editor
Database Supabase (PostgreSQL)
Auth Supabase Auth and Googel OAuth
AI Vercel AI SDK, @ai-sdk/anthropic
Payments Stripe
Hosting Vercel

Security

If you find a security vulnerability, please email [email protected] instead of opening a public issue.

Self-Hosting

Hosting the compile service

The LaTeX compile service lives in services/compile/ (Go + TeX Live). The Next.js app talks to it through COMPILE_SERVICE_URL (server-side relay at app/api/compile-pdf/) and NEXT_PUBLIC_COMPILE_SERVICE_URL (direct browser calls).

  • API: POST /compile takes { files: [{ path, content }], projectId?, lastModifiedFile? } and returns raw PDF bytes (application/pdf) on success, or JSON with error, log, stdout, stderr on failure. POST /synctex maps between source and PDF positions; GET /health reports queue status.
  • Auth: when SUPABASE_JWT_SECRET is set, /compile and /synctex require Authorization: Bearer <supabase-access-token>. Leave it unset for local development.
  • Docker: see services/compile/deployments/ and services/compile/README.md. The deploy scripts in services/compile/deploy/ read the target host from SERVER_IP, or DEPLOY_HOST / STAGING_DEPLOY_HOST in services/compile/.env. They never sync .env: the production .env (with SUPABASE_JWT_SECRET) lives only on the server.

Hosting the agent server

The AI editing agent is included in this repo under services/agent/ and can be hosted independently.

Local/dev run

cd services/agent
npm install
cp ../../.env.example .env
# Fill required values in services/agent/.env (see below)
npm run dev

The service starts on http://localhost:8787 and exposes POST /agent.

Production (Docker)

cd services/agent
docker build -t octra-agent:latest .
docker compose up -d

docker-compose.yml maps port 8787:8787 and reads environment variables from services/agent/.env.

Required environment variables for agent server

  • ANTHROPIC_API_KEY (required)
  • SUPABASE_JWT_SECRET (optional but recommended; when set, /agent requires Bearer JWT)
  • SUPABASE_URL (optional; also accepts tokens signed with the project's asymmetric JWT signing keys, e.g. local supabase start stacks)
  • AGENT_SERVICE_SECRET (recommended; when set, every request except /health must carry it in the X-Octree-Proxy-Secret header, which the Next.js proxy sends from its own AGENT_SERVICE_SECRET. Unset logs a warning and skips the check)
  • COMPILE_SERVICE_URL (optional; enables agent compile tool)
  • PORT (optional; defaults to 8787)

Connect the Next.js app to your hosted agent

Set in .env.local:

CLAUDE_AGENT_SERVICE_URL=http://localhost:8787
AGENT_SERVICE_SECRET=  # same value as in services/agent/.env

If hosting remotely, replace with your public/internal URL.

License

LGPL-3.0 — see LICENSE for details.

관련 프로젝트 살펴보기

불러오는 중…