llama-cloud 2.2.0


pip install llama-cloud

  Latest version

Released: Apr 03, 2026


Meta
Author: Llama Cloud
Requires Python: >=3.9

Classifiers

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Operating System
  • MacOS
  • Microsoft :: Windows
  • OS Independent
  • POSIX
  • POSIX :: Linux

Programming Language
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

Llama Cloud Python SDK

PyPI version

The official Python SDK for LlamaParse - the enterprise platform for agentic OCR and document processing.

With this SDK, create powerful workflows across many features:

  • Parse - Agentic OCR and parsing for 130+ formats
  • Extract - Structured data extraction with custom schemas
  • Classify - Document categorization with natural-language rules
  • Agents - Deploy document agents as APIs
  • Index - Document ingestion and embedding for RAG

Documentation

Installation

pip install llama_cloud

Quick Start

import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)

# Parse a document
job = client.parsing.create(
    tier="agentic",
    version="latest",
    file_id="your-file-id",
)

print(job.id)

File Uploads

from pathlib import Path
from llama_cloud import LlamaCloud

client = LlamaCloud()

# Upload using a Path
client.files.create(
    file=Path("/path/to/document.pdf"),
    purpose="parse",
)

# Or using bytes with a tuple of (filename, contents, media_type)
client.files.create(
    file=("document.txt", b"content", "text/plain"),
    purpose="parse",
)

Async Usage

import asyncio
from llama_cloud import AsyncLlamaCloud

client = AsyncLlamaCloud()


async def main():
    job = await client.parsing.create(
        tier="agentic",
        version="latest",
        file_id="your-file-id",
    )
    print(job.id)


asyncio.run(main())

MCP Server

Use the Llama Cloud MCP Server to enable AI assistants to interact with the API:

Add to Cursor Install in VS Code

Error Handling

When the API returns a non-success status code, an APIError subclass is raised:

import llama_cloud
from llama_cloud import LlamaCloud

client = LlamaCloud()

try:
    client.pipelines.list(project_id="my-project-id")
except llama_cloud.APIError as e:
    print(e.status_code)  # 400
    print(e.__class__.__name__)  # BadRequestError
Status Code Error Type
400 BadRequestError
401 AuthenticationError
403 PermissionDeniedError
404 NotFoundError
422 UnprocessableEntityError
429 RateLimitError
>=500 InternalServerError
N/A APIConnectionError

Retries and Timeouts

The SDK automatically retries requests 2 times on connection errors, timeouts, rate limits, and 5xx errors. Requests timeout after 1 minute by default. Functions that combine multiple API calls (e.g. client.parsing.parse()) will have larger timeouts by default to account for the multiple requests and polling.

client = LlamaCloud(
    max_retries=0,  # Disable retries (default: 2)
    timeout=30.0,  # 30 second timeout (default: 1 minute)
)

Pagination

List methods support auto-pagination with for loops:

for run in client.extraction.runs.list(
    extraction_agent_id="agent-id",
    limit=20,
):
    print(run)

Or fetch one page at a time:

page = client.extraction.runs.list(extraction_agent_id="agent-id", limit=20)
for run in page.items:
    print(run)

while page.has_next_page():
    page = page.get_next_page()

Logging

Configure logging via the LLAMA_CLOUD_LOG environment variable or the log option:

client = LlamaCloud(
    log="debug",  # "debug" | "info" | "warn" | "error" | "off"
)

Requirements

  • Python 3.9+

Contributing

See CONTRIBUTING.md.

2.2.0 Apr 03, 2026
2.1.0 Apr 01, 2026
2.0.0 Mar 31, 2026
1.6.0 Mar 05, 2026
1.5.0 Mar 03, 2026
1.4.1 Feb 18, 2026
1.4.0 Feb 12, 2026
1.3.0 Feb 04, 2026
1.2.0 Jan 30, 2026
1.1.0 Jan 26, 2026
1.0.0 Jan 21, 2026
1.0.0b7 Jan 20, 2026
1.0.0b6 Jan 19, 2026
1.0.0b5 Jan 17, 2026
1.0.0b4 Jan 16, 2026
1.0.0b3 Jan 14, 2026
1.0.0b2 Jan 07, 2026
1.0.0b1 Dec 23, 2025
0.1.46 Jan 21, 2026
0.1.45 Dec 03, 2025
0.1.44 Nov 04, 2025
0.1.43 Oct 02, 2025
0.1.42 Sep 16, 2025
0.1.41 Sep 05, 2025
0.1.40 Aug 29, 2025
0.1.39 Aug 17, 2025
0.1.37 Aug 04, 2025
0.1.36 Aug 01, 2025
0.1.35 Jul 28, 2025
0.1.34 Jul 16, 2025
0.1.33 Jul 08, 2025
0.1.32 Jul 08, 2025
0.1.31 Jul 07, 2025
0.1.30 Jun 27, 2025
0.1.29 Jun 25, 2025
0.1.28 Jun 23, 2025
0.1.27 Jun 20, 2025
0.1.26 Jun 10, 2025
0.1.25 Jun 10, 2025
0.1.24 Jun 09, 2025
0.1.23 May 28, 2025
0.1.22 May 20, 2025
0.1.21 May 08, 2025
0.1.20 May 05, 2025
0.1.19 Apr 25, 2025
0.1.18 Apr 09, 2025
0.1.17 Mar 28, 2025
0.1.16 Mar 22, 2025
0.1.15 Mar 18, 2025
0.1.14 Mar 07, 2025
0.1.13 Feb 19, 2025
0.1.12 Feb 09, 2025
0.1.11 Jan 27, 2025
0.1.10 Jan 22, 2025
0.1.9 Jan 15, 2025
0.1.8 Jan 07, 2025
0.1.7 Dec 23, 2024
0.1.7a1 Dec 21, 2024
0.1.6 Dec 02, 2024
0.1.5 Nov 12, 2024
0.1.4 Oct 18, 2024
0.1.3 Oct 18, 2024
0.1.2 Oct 04, 2024
0.1.1 Oct 03, 2024
0.1.0 Sep 24, 2024
0.0.17 Sep 05, 2024
0.0.16 Sep 05, 2024
0.0.15 Aug 22, 2024
0.0.14 Aug 21, 2024
0.0.13 Aug 08, 2024
0.0.12 Aug 06, 2024
0.0.11 Jul 24, 2024
0.0.10 Jul 23, 2024
0.0.9 Jul 11, 2024
0.0.8 Jul 09, 2024
0.0.7 Jun 25, 2024
0.0.6 Jun 21, 2024
0.0.5 Jun 20, 2024
0.0.4 Jun 20, 2024
0.0.3 Jun 19, 2024
0.0.2 Jun 19, 2024
0.0.1 Jun 19, 2024

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
anyio (<5,>=3.5.0)
distro (<2,>=1.7.0)
httpx (<1,>=0.23.0)
pydantic (<3,>=1.9.0)
sniffio
typing-extensions (<5,>=4.14)