Llama Cloud Services SDK (Deprecated)
This library provides tailored SDK clients for LlamaCloud services such as LlamaParse, LlamaExtract, and LlamaCloud Index. As of January 2026, this package is officially deprecated and will only be maintained until May 1, 2026. Users are strongly advised to migrate to the `llama-cloud` Python package for continued support and new features.
Warnings
- breaking The `llama-cloud-services` package is officially deprecated and will no longer be maintained after May 1, 2026. New features and bug fixes will only be released for the new `llama-cloud` package.
- gotcha When migrating to the new `llama-cloud` package, import paths and client initialization patterns have changed. Direct replacements of `LlamaParse`, `LlamaExtract`, and `LlamaCloudIndex` from `llama_cloud_services` will not work.
- gotcha API keys are sensitive. Storing them directly in code is a security risk. The `api_key` parameter is mandatory for client initialization.
- gotcha LlamaCloud services can be hosted in different regions (e.g., US and EU). The default base URL might not be suitable for all deployments.
Install
-
pip install llama-cloud-services -
pip install llama-cloud>=1.0
Imports
- LlamaParse
from llama_cloud_services import LlamaParse
- LlamaExtract
from llama_cloud_services import LlamaExtract
- LlamaCloudIndex
from llama_cloud_services import LlamaCloudIndex
- EU_BASE_URL
from llama_cloud_services import EU_BASE_URL
Quickstart
import os
from llama_cloud_services import LlamaParse
# Get your API key from LlamaCloud. Recommended to use environment variables.
LLAMA_CLOUD_API_KEY = os.environ.get('LLAMA_CLOUD_API_KEY', 'your_api_key_here')
if LLAMA_CLOUD_API_KEY == 'your_api_key_here':
print("WARNING: Please set the LLAMA_CLOUD_API_KEY environment variable or replace 'your_api_key_here' with your actual key.")
# Initialize LlamaParse
parser = LlamaParse(api_key=LLAMA_CLOUD_API_KEY)
# Example usage (assuming you have a file_id from an uploaded document)
# This is a conceptual example as parsing a file requires prior upload.
# For a full workflow, refer to the LlamaCloud documentation.
print("LlamaParse client initialized. You can now use it to parse documents.")
# To parse a document, you would typically upload a file first and then use its ID:
# job = parser.create(tier="agentic", version="latest", file_id="your_uploaded_file_id")
# print(f"Parsing job created with ID: {job.id}")