Llama Cloud Services

repository·main·Indexed 26 days ago

https://github.com/run-llama/llama_cloud_services

Managed services for RAG workflows, including parsing (LlamaParse), extraction (LlamaExtract), classification (LlamaClassify), and indexing (LlamaCloud Index). This repository provides TypeScript and Python examples for these services. Note: This repository and the llama-parse package are deprecated in favor of the llama-cloud and @llamaindex/llama-cloud packages.

Tokens
45.1K
Snippets
110
Records
239
Agent score
88%

What's inside llama_cloud_services

  1. Explore LlamaCloud Services TypeScript examples

    main

    The examples-ts directory contains several TypeScript end-to-end applications demonstrating how to use LlamaCloud services. Specifically, you can find examples for:

    • LlamaParse: For document parsing tasks.
    • LlamaCloud Index: For indexing and retrieval tasks.

    To use these examples, navigate to the specific sub-directory (./parse/ or ./index/) and follow the instructions provided within those folders.

  2. Explore LlamaCloud Services Python examples

    main

    This repository contains Python notebooks providing examples for the following LlamaCloud services:

    • LlamaParse: For document parsing.
    • LlamaExtract: For data extraction.
    • LlamaCloudIndex: For indexing services.

    To use these examples, navigate to the respective subdirectories and follow the instructions provided within each notebook.

  3. Install and set up the LlamaExtract Demo

    main

    To run the LlamaExtract TypeScript demo, ensure you have Node.js (v18+) and pnpm installed. Follow these steps to clone, install dependencies, and configure your environment:

    1. Clone the repository and navigate to the extract directory:
      git clone https://github.com/run-llama/llama_cloud_services
      cd lama_cloud_services/examples-ts/extract/
    2. Install dependencies:
      npm install
    3. Set your LlamaCloud API key in your environment:
      export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
    git clone https://github.com/run-llama/llama_cloud_services
    cd lama_cloud_services/examples-ts/extract/
    npm install
    export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
  4. Install and set up the LlamaParse Demo

    main

    To run the LlamaParse TypeScript demo, you need Node.js (v18+), pnpm, an OpenAI API key, and a LlamaCloud API key.

    1. Clone the repository and navigate to the demo directory:
    git clone https://github.com/run-llama/llama_cloud_services
    cd lama_cloud_services/examples-ts/parse/
    1. Install dependencies:
    pnpm install
    1. Configure your environment variables:
    export OPENAI_API_KEY="your-openai-api-key"
    export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
    git clone https://github.com/run-llama/llama_cloud_services
    cd lama_cloud_services/examples-ts/parse/
    pnpm install
    
    export OPENAI_API_KEY="your-openai-api-key"
    export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
  5. Install LlamaParse

    main

    To use LlamaParse, first ensure you have an API key from https://cloud.llamaindex.ai/api-key.

    If you are upgrading from llama-index v0.9.X or older, uninstall the old version first to avoid conflicts. Then, install the latest llama-index and llama-parse packages.

    # Run this if upgrading from v0.9.x or older
    pip uninstall llama-index
    pip install -U llama-index --upgrade --no-cache-dir --force-reinstall
    
    # Install LlamaParse
    pip install llama-parse
  6. Run the LlamaCloud Index Demo

    main

    Use the following commands to interact with the demo application:

    • Start the Demo: Runs the application in standard mode. It will display a welcome screen and prompt you to start chatting.
      pnpm run start
    • Development Mode: Runs the application with hot reload support for active development.
      pnpm run dev
    • Build the Project: Compiles the project for production.
      pnpm run build
    pnpm run start
  7. Install and run the LlamaClassify Demo

    main

    The LlamaClassify Demo is a TypeScript application that showcases the LlamaClassify agentic document classification service. It allows you to classify documents (e.g., financial statements) based on custom rules and provides reasoning-based insights and confidence scores.

    Prerequisites

    • Node.js (version 22 or higher)
    • pnpm package manager
    • LlamaCloud API key

    Installation Steps

    1. Clone the repository and navigate to the classify directory:
    git clone https://github.com/run-llama/llama_cloud_services
    cd lama_cloud_services/examples-ts/classify/
    1. Install dependencies:
    npm install
    1. Set your LlamaCloud API key in your environment:
    export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"

    Running the Demo

    Start the development server with:

    npm run dev

    The application will be available at http://localhost:3000.

    git clone https://github.com/run-llama/llama_cloud_services
    cd lama_cloud_services/examples-ts/classify/
    npm install
    export LLAMA_CLOUD_API_KEY="your-llamacloud-api-key"
    npm run dev