Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,26 @@ You can follow these steps to generate a PageIndex tree from a PDF document.
### 1. Install dependencies

```bash
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade -r requirements.txt
```

On Windows PowerShell:

```powershell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade -r requirements.txt
```

If PowerShell blocks `Activate.ps1`, allow scripts for the current shell session and retry:

```powershell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps1
```

### 2. Set your LLM API key

Create a `.env` file in the root directory with your LLM API key. Multi-LLM is supported via [LiteLLM](https://docs.litellm.ai/docs/providers):
Expand All @@ -161,6 +178,18 @@ Create a `.env` file in the root directory with your LLM API key. Multi-LLM is s
OPENAI_API_KEY=your_openai_key_here
```

For non-OpenAI providers, set the provider-specific key required by LiteLLM and pass the matching model name:

```bash
DASHSCOPE_API_KEY=your_dashscope_key_here
```

```bash
python3 run_pageindex.py --pdf_path /path/to/your/document.pdf --model dashscope/qwen-plus
```

Use the model prefix and environment variable documented by your LiteLLM provider, such as `anthropic/...`, `gemini/...`, `deepseek/...`, or `dashscope/...`.

### 3. Generate PageIndex structure for your PDF

```bash
Expand Down