Three Ways to Parse
There are three ways to parse documents with AILANG Parse. Pick the one that fits:
| Browser (WASM) | API + SDKs | Run Locally | |
|---|---|---|---|
| Install required | None | SDK only | AILANG CLI |
| Office parsing | Yes | Yes | Yes |
| AI / PDF parsing | With API key | Yes | Local backends by default; AI opt-in for scans |
| Offline capable | Yes (Office) | No | Yes (Office + PDFs, including scans via docling) |
| Throughput | Browser-limited | Unlimited (paid) | Unlimited |
| Cost | Free | Free tier, then paid | Free (bring your own AI keys) |
| Data privacy | Stays in browser | Regional servers (EU). Data handling → | Stays on your machine |
Quick Start
Parse a document in two commands:
# Install AILANG
curl -fsSL https://ailang.sunholo.com/install.sh | bash
# Install AILANG Parse from the package registry
ailang install sunholo/ailang_parse
That puts a docparse command on your PATH. Now parse a document. The output is saved next to it:
# Parse a DOCX file — output lands next to it as your-file.docx.json / .md
docparse your-file.docx
ailang install route gives you the basic command: one file in, JSON/Markdown or a --convert file out. The full docparse command adds --describe, batch folders, --output-dir, PDF backends and --install-backends. Its installer also installs AILANG if you skipped the first step:
curl -fsSL https://www.sunholo.com/ailang-parse/install.sh | sh
Contributors: git clone https://github.com/sunholo-data/ailang-parse.git and run ./bin/docparse (bin\docparse.cmd on Windows) from the checkout.
Convert between formats:
# DOCX to HTML
docparse input.docx --convert output.html
# CSV to DOCX report
docparse data.csv --convert report.docx
# Markdown to PowerPoint slides
docparse notes.md --convert slides.pptx
# Any format to Quarto Markdown (for Quarto rendering)
docparse report.docx --convert report.qmd
Generate documents with AI:
# Generate a DOCX report from a prompt
docparse --generate report.docx --prompt "Q1 sales report with revenue table" --ai gemini-3.5-flash-lite
Install AILANG
Step 1: Install the AILANG CLI
AILANG is a single binary that needs nothing else installed. Install it for your platform:
# macOS / Linux
curl -fsSL https://ailang.sunholo.com/install.sh | bash
# Windows (PowerShell)
irm https://ailang.sunholo.com/install.ps1 | iex
Or download it for any platform from GitHub releases.
Verify the installation:
ailang --version
# prints the installed version
Step 2: Install AILANG Parse
Install the parsing package from the AILANG registry:
ailang install sunholo/ailang_parse
This downloads the parser and everything it needs. There is no build step.
Optional: Clone the Source
To develop, test or run the benchmarks, clone the repository:
# macOS / Linux
git clone https://github.com/sunholo-data/ailang-parse.git
cd ailang-parse
./bin/docparse data/test_files/sample.docx
# Type-check all modules
./bin/docparse --check
# Windows
git clone https://github.com/sunholo-data/ailang-parse.git
cd ailang-parse
bin\docparse.cmd data\test_files\sample.docx
# Type-check all modules
bin\docparse.cmd --check
Batch Mode & Folder Parsing
Parse many files in one command. It is 5–15x faster than parsing them one at a time:
# Parse all emails in a directory
docparse ~/inbox/
# Parse specific files (auto-detects batch mode)
docparse report.docx slides.pptx data.xlsx
# Glob patterns work too
docparse *.eml
# A folder and all its subfolders; outputs keep the folder structure
docparse -r ~/Archive/ --output-dir parsed/
For an archive of thousands or millions of files, see parsing a document archive: every core at once, and how long it takes.
What is AILANG?
AILANG is a general-purpose programming language for AI-powered applications. A program has to declare when it calls AI, reads files or uses the network, and each of these has a hard budget: a cap on how many AI calls, file reads or network requests the program can make. The language enforces these limits; they are not just a convention.
AILANG also has formal contracts checked by the Z3 solver, repeatable results for code that does not call AI, and a package registry for sharing code. The result is programs you can audit and reproduce, with predictable costs.
AILANG Parse is one application built on AILANG. Once the CLI is installed, you can build your own AI-powered tools (document processors, data pipelines, code generators, agents) with the same language and tools.
ailang prompt for the full language reference, or visit ailang.sunholo.com for documentation, examples, and the package registry.AI Models (and local PDF backends)
Office formats (DOCX, PPTX, XLSX, etc.) are parsed without AI. PDFs are read locally with pdftotext by default (no API key, no network call). Scanned or image-only pages switch automatically to the local docling backend; liteparse is another local option. Images, audio and video need an AI provider. For PDFs, AI runs only when you ask for it (--pdf-backend ai).
--pdf-backend docling and --pdf-backend liteparse use no AI and need no API key. On a 100 KB arxiv paper they were about 5× and 40× faster than AI. See the PDF parsing page for details. The AI models below are an option for scans, handwriting and complex layouts.Google (Vertex AI / AI Studio)
# With Google Cloud credentials already set up
GOOGLE_API_KEY="" docparse document.pdf --pdf-backend ai --ai gemini-3.5-flash-lite
# Via API key (local development)
GOOGLE_API_KEY="your-key" docparse document.pdf --pdf-backend ai --ai gemini-3.5-flash-lite
Anthropic (Claude)
ANTHROPIC_API_KEY="sk-ant-..." docparse document.pdf --pdf-backend ai --ai claude-haiku-4-5
Ollama (Local, Free)
# Start Ollama and pull a model
ollama pull granite3.2-vision
# Run AILANG Parse with local model (no API key needed)
docparse document.pdf --pdf-backend ai --ai granite-docling
Audio & Video
# Transcribe audio — returns transcription, speaker count, language
docparse recording.mp3 --ai gemini-3.5-flash-lite
# Extract video content — visual scenes, tables, transcription
docparse presentation.mp4 --ai gemini-3.5-flash-lite
# Convert audio transcription to DOCX
docparse interview.wav --ai gemini-3.5-flash-lite --convert transcript.docx
# Convert video content to HTML report
docparse tutorial.mp4 --ai gemini-3.5-flash-lite --convert report.html
Audio formats: WAV, MP3, AIFF, AAC, OGG, FLAC. Video formats: MP4, MOV, AVI, WebM, WMV, MPEG, MPG, FLV, 3GPP.
gemini-3.5-flash-lite, the default. Ollama models score lower on our PDF benchmark (0-3%) because they struggle to return structured JSON.SDKs (API, not local)
The Python, JavaScript and Go SDKs call the hosted API. They do not parse on your machine. Use them when you want nothing to install or maintain.
# Python
pip install ailang-parse
# JavaScript / TypeScript
npm install @ailang/parse
# Go
go get github.com/sunholo-data/ailang-parse-go
Example (Python):
from ailang_parse import DocParse
client = DocParse(api_key="dp_YOUR_KEY")
result = client.parse_file("report.docx")
for block in result.blocks:
print(block.type, block.text)
The hosted API has a free tier (1,000 requests/month + 50 AI parses). See the API documentation for details, authentication and pricing.
Configuration
Configure local parsing with environment variables and AILANG capability budgets.
?api=http://localhost:8080 to any API docs page URL, and every curl example, code snippet and live playground points at your local server.
Environment Variables
| Variable | Default | Description |
|---|---|---|
| GOOGLE_API_KEY | (empty) | Google AI Studio API key for Gemini models (PDF, image, audio, video parsing) |
| ANTHROPIC_API_KEY | (empty) | Anthropic API key for Claude models |
| DOCPARSE_OUTPUT_DIR | docparse/data | Output directory for parsed results |
Office formats (DOCX, PPTX, XLSX, ODT, ODP, ODS) need no API key. They are parsed offline, without AI.
Capability Budgets
AILANG sets hard limits on what the parser can do. A run that reaches a limit stops.
| Capability | Budget | Purpose |
|---|---|---|
| IO @limit | 50,000 | Console output operations |
| FS @limit | 5,000 | File system reads (ZIP entries, output writes) |
| AI @limit | 30 | AI model calls (PDF pages, image descriptions) |
| Net | unlimited | HTTP requests (metadata, AI endpoints) |
| Rand | unlimited | Random number generation |
| Clock | unlimited | Timestamp access |
Supported Formats
| Format | Strategy | Features |
|---|---|---|
| DOCX | Deterministic | Track changes, merged cells, text boxes, comments, headers/footers, footnotes, endnotes, images |
| PPTX | Deterministic | Slides, tables, images, metadata |
| XLSX | Deterministic | Shared strings, multiple sheets, merged cells |
| ODT | Deterministic | ODF text, headers/footers, images |
| ODP | Deterministic | ODF presentation slides |
| ODS | Deterministic | ODF spreadsheet sheets |
| HTML | Deterministic | Well-formed HTML parsed directly; AI fallback for malformed HTML |
| Markdown | Deterministic | Headings, lists, tables, code blocks, links |
| CSV / TSV | Deterministic | Delimiter detection, quoted fields |
| EPUB | Deterministic | Chapters, images, metadata |
| Local backend default | Text and scanned PDFs with pdftotext / docling / liteparse; AI only if you ask for it | |
| PNG / JPG | AI Required | Document image extraction or description |
| Audio .wav .mp3 .aiff .aac .ogg .flac | AI Required | Full transcription, speaker detection, language identification, content summary |
| Video .mp4 .mov .avi .webm .wmv .mpeg .mpg .flv .3gpp | AI Required | Visual content extraction (headings, tables, text, images), spoken-word transcription |
| QMD (Quarto) | Generate only | Quarto Markdown with YAML front matter, CriticMarkup for track changes, pipe/grid tables |
Docker
Prefer containers? The repository includes a Dockerfile for the CLI:
# Build the image
git clone https://github.com/sunholo-data/ailang-parse.git
cd ailang-parse
docker build -t docparse .
# Parse a file (mount your documents into /data)
docker run -v $(pwd):/data docparse /data/report.docx
# Parse with AI (pass your API key)
docker run -e GOOGLE_API_KEY="your-key" \
-v $(pwd):/data docparse --ai gemini-3.5-flash-lite /data/document.pdf
The image contains AILANG, the parser and everything they need, and runs the CLI directly. It does not include an API server: it is for batch processing in containers.
Use the hosted API (1,000 free requests/month). Or contact us about a managed deployment of your own, or about Sunholo Multivac, our AI platform with dedicated support.
Contact Sunholo →
Frequently Asked Questions
How do I install AILANG Parse?
Run curl -fsSL https://ailang.sunholo.com/install.sh | bash to install AILANG, then ailang install sunholo/ailang_parse to install the parser and put the docparse command on your PATH. Office parsing needs nothing else installed.
What are the system requirements?
AILANG is a single binary. It runs on macOS, Linux (amd64/arm64) and Windows. Office parsing runs comfortably on a laptop with no GPU. PDFs that contain text are read locally with pdftotext by default; scanned PDFs switch automatically to the local docling backend. AI is used only if you ask for it, through Gemini, Claude or a local Ollama model.
What's the difference between the API and running locally?
The hosted API needs no setup or maintenance and comes with Python, JS and Go SDKs, with 1,000 free requests per month. Running locally gives you unlimited free parsing with full privacy, but you install the AILANG CLI on your machine. Both use the same parser.
Does local parsing require an internet connection?
No, not for Office formats (DOCX, PPTX, XLSX, ODF) or PDFs, including scanned ones (read by the local docling backend). They are parsed offline, with no API key. AI runs only if you ask for it (--pdf-backend ai) and needs a connection to Gemini or Claude, unless you use a local Ollama model, which also works offline.
Can I use AILANG for other projects?
Yes. AILANG is a general-purpose programming language for AI-powered applications. Once it is installed, you can build your own tools with capability budgets, formal contracts and your choice of AI model. Run ailang prompt for the full language reference, or visit ailang.sunholo.com to explore the ecosystem.