run-llama/llama-parse-py
Typed Python SDK for cloud OCR and document parsing through the Llama Cloud API
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
llama_cloud is a Stainless-generated Python client for the Llama Cloud REST API, not a document-processing engine. A typical flow uploads a document through files.create, then passes its file ID to parsing.create, which returns a job ID. The application owns workflow orchestration; Llama Cloud executes OCR and parsing.
LlamaCloud and AsyncLlamaCloud expose the same API operations through synchronous and asynchronous interfaces. The package uses httpx>=0.23.0,<1 and pydantic>=1.9.0,<3, with TypedDicts for nested requests and Pydantic models for responses. Custom transports, proxies, a configurable base URL, and lower-level HTTP methods provide escape hatches without requiring a fork.
Key Capabilities & Differentiators
Parsing accepts a tier and a version; examples use fast and agentic. Uploads accept bytes, a path-like object, or a tuple containing filename, content, and media type. The async client reads path-like uploads asynchronously. The SDK also exposes extraction and index operations, and paginated list calls support either automatic iteration or explicit cursor handling.
Pydantic responses can be serialized to JSON or dictionaries, and model_fields_set distinguishes an omitted field from an explicit null. Raw-response wrappers expose HTTP headers; streaming wrappers defer reading the body and use a context manager to close the response. This is HTTP response streaming, not a guarantee that parsing results arrive incrementally.
Trade-offs & Limitations
Compared with handwritten REST calls, the SDK removes much of the boilerplate for request types, pagination, retries, and error mapping while retaining access to raw HTTP responses. Compared with a local OCR and parsing stack, it avoids running the processing engine yourself but puts network latency, service limits, and usage costs on the ingestion path. The MIT license covers the SDK, not an offline or self-hosted edition of the service.
The default one-minute timeout applies to a request, not the full parsing job. Connection errors and HTTP 408, 409, 429, and 5xx responses are retried twice by default. Set a separate job deadline, cap concurrency, and verify the API's duplicate-submission behavior before layering application retries over job creation. For sensitive inputs, confirm cloud-service data handling before committing to the integration.
Hardware & Deployment Guide
Install llama_cloud on Python 3.9 or later and supply LLAMA_CLOUD_API_KEY through the runtime's secret configuration. The application needs network access to Llama Cloud, not local model weights or a GPU. Both clients default to httpx; install llama_cloud[aiohttp] and pass DefaultAioHttpClient() if the async workload benefits from that backend. Reuse clients for connection pooling and close them on shutdown.
Release v2.18.0 moved Index v2 indexing, retrieval, and chat out of beta, and exposed Verify under client.alpha.verify. v2.19.0 added expand=usage to the classification job GET endpoint, while v2.20.0 exposed the Max effort option for extraction. Pin the SDK and run integration tests before upgrading; the package allows some breaking changes in minor releases.
Python teams that have selected Llama Cloud and want typed sync or async integration for document parsing and extraction in a production RAG ingestion pipeline.
Documents must stay offline or inside your network, you need to self-host the processing engine, or you cannot accept a managed API's latency, limits, or data-handling terms.
Quick Start & Installation
# install from PyPI pip install llama_cloud
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| llama-parse-py ★ | 70 | +1 | Python | MIT | Typed Python SDK for cloud OCR and document parsing through the Llama Cloud API |
| llama_index | 53.1k | +106 | Python | MIT | A modular Python SDK for document ingestion, indexing, and RAG |
| retrieval-agent-template | 183 | — | Python | MIT | Two LangGraph workflows for document indexing and user-scoped RAG chat |
| liteparse | 13.6k | +212 | Rust | Apache-2.0 | Rust and PDFium for local document parsing with layout and OCR |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/run-llama/llama-parse-py.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about llama-parse-py
How do I add parsing to an existing Python ingestion pipeline?
client.files.create, then pass its file_id to client.parsing.create with the desired tier and version. Keep the returned parsing job ID so your application can track the job separately from the HTTP request that submitted it.Does the SDK need a GPU, and what drives local resource usage?
What does the MIT license cover for commercial use and self-hosting?
When should I use direct REST calls or a local OCR stack instead?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy