{"id":2578,"library":"llama-index-readers-llama-parse","title":"LlamaParse Reader for LlamaIndex","description":"The `llama-index-readers-llama-parse` library provides a LlamaIndex reader that integrates with LlamaParse. It enables parsing of various complex file types (like PDFs, PPTs, etc.) into structured markdown, which can then be easily ingested and processed by LlamaIndex for RAG and other LLM applications. The current version is 0.6.1, and it's part of the broader LlamaIndex ecosystem, implying a regular release cadence with LlamaIndex.","status":"active","version":"0.6.1","language":"en","source_language":"en","source_url":"https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/readers/llama-parse","tags":["llamaindex","reader","llm","parser","document processing","pdf"],"install":[{"cmd":"pip install llama-index-readers-llama-parse llama-parse","lang":"bash","label":"Install reader and core parser"}],"dependencies":[{"reason":"Core parsing engine used by the reader.","package":"llama-parse","optional":false},{"reason":"Base LlamaIndex package (peer dependency for LlamaIndex applications).","package":"llama-index-core","optional":false}],"imports":[{"symbol":"LlamaParseReader","correct":"from llama_index.readers.llama_parse import LlamaParseReader"}],"quickstart":{"code":"import os\nfrom llama_index.readers.llama_parse import LlamaParseReader\n\n# Ensure you have your LlamaParse API key set as an environment variable\n# os.environ[\"LLAMAPARSE_API_KEY\"] = \"your-api-key\"\napi_key = os.environ.get('LLAMAPARSE_API_KEY', '')\n\nif not api_key:\n    raise ValueError(\"LLAMAPARSE_API_KEY environment variable not set.\")\n\n# Initialize the LlamaParse reader\n# For advanced options, see LlamaParseReader documentation (e.g., result_type='markdown')\nparser = LlamaParseReader(api_key=api_key, verbose=True)\n\n# Load data from a file (replace 'path/to/your/document.pdf' with an actual file)\n# LlamaParse supports various file types like PDF, PPTX, DOCX, TXT, CSV, JSON, XML\n# Note: This is an asynchronous operation and may take time to complete.\n# The load_data method will poll LlamaParse until the parsing is complete.\ntry:\n    documents = parser.load_data(\"path/to/your/document.pdf\")\n    print(f\"Successfully parsed {len(documents)} document(s).\")\n    for doc in documents:\n        print(f\"Document ID: {doc.id_}\")\n        print(f\"First 200 chars: {doc.text[:200]}...\")\nexcept Exception as e:\n    print(f\"Error parsing document: {e}\")\n    print(\"Make sure 'path/to/your/document.pdf' exists and your API key is valid.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `LlamaParseReader` and load data from a local file. It highlights the mandatory `LLAMAPARSE_API_KEY` and shows how to access the parsed documents. Remember to replace 'path/to/your/document.pdf' with an actual file path."},"warnings":[{"fix":"Set `os.environ['LLAMAPARSE_API_KEY'] = 'your_key_here'` or pass `api_key='your_key_here'` to the `LlamaParseReader` constructor.","message":"A `LLAMAPARSE_API_KEY` is mandatory for using LlamaParseReader. This key must be obtained from LlamaIndex and provided either directly during initialization or via the environment variable `LLAMAPARSE_API_KEY`.","severity":"gotcha","affected_versions":"All"},{"fix":"Monitor your LlamaParse usage and consult the LlamaParse documentation for pricing and rate limit details.","message":"LlamaParse is a commercial service. While a free tier may be available, extensive usage or specific features might incur costs or be subject to rate limits. Be aware of your LlamaParse plan and associated usage policies.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure both `llama-index-readers-llama-parse` and `llama-parse` are installed using `pip install llama-index-readers-llama-parse llama-parse`.","message":"The `llama-parse` package is a separate dependency and must be explicitly installed alongside `llama-index-readers-llama-parse`. Failing to install `llama-parse` will result in runtime errors.","severity":"gotcha","affected_versions":"All"},{"fix":"For improved responsiveness in asynchronous applications, use `await parser.load_data_async(...)`.","message":"Parsing large or complex documents with LlamaParse can be time-consuming. The `load_data()` method by default polls the LlamaParse API until the job is complete, which can lead to long execution times for synchronous calls. Consider using `load_data_async()` for non-blocking operations in production environments.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}