Skip to main content

A tool for converting PDFs to text files using Ollama.

Project description

llama-scan

A tool for converting PDFs to text files using Ollama.

Features

  • Convert PDFs to text files locally, no token costs.
  • Use the latest multimodal models supported by Ollama.
  • Turn images and diagrams into detailed text descriptions.

Requirements

  • Python 3.10+
  • Ollama installed and running locally

Installing Ollama and the Default Model

  1. Install Ollama
  2. Pull the default model:
ollama run qwen2.5vl:latest

Installation

Install using pip:

pip install llama-scan

or uv:

uv tool install llama-scan

Usage

Basic usage:

llama-scan path/to/your/file.pdf

Options

  • --output, -o: Output directory (default: "output")
  • --model, -m: Ollama model to use (default: "qwen2.5vl:latest")
  • --start, -s: Start page number (default: 0)
  • --end, -e: End page number (default: 0)
  • --custom-instructions, -c: Optional path to a text file containing additional instructions (default: None)
  • --server-url, -u: Ollama server URL (default: "http://localhost:11434")
  • --width, -w: Width of the resized images (0 to skip resizing; default: 0)
  • --keep-images, -k: Keep the intermediate image files (default: False)
  • --stdout, -s: Write merged output to stdout (default: False)

Examples

Process specific pages:

llama-scan document.pdf --start 1 --end 5

Use a different Ollama model:

llama-scan document.pdf --model qwen2.5vl:3b

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_scan-0.1.8.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_scan-0.1.8-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file llama_scan-0.1.8.tar.gz.

File metadata

  • Download URL: llama_scan-0.1.8.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for llama_scan-0.1.8.tar.gz
Algorithm Hash digest
SHA256 edaa8e47d62332ff21a16879b676c6da88a7b7af51816e4e0bc047cffff92af4
MD5 6cfb9043b20aac6f469c2fec92278eca
BLAKE2b-256 57e61ae77dff3c0c32fc7cb05b623c0ca23525bdc8032c3e6093925c8a8b38e9

See more details on using hashes here.

File details

Details for the file llama_scan-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_scan-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d10b1dd3e264b184c065ad909eecced5af5532feb5ac20c1a31688eed7522a54
MD5 b8b92787211730188de31af65ae84814
BLAKE2b-256 ac17d8b24bab37dd5e24cc6ddb4de8e1215899469d992917f90b6c5bf5a48b72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page