Skip to content

Run the examples

Extract scientific facts, equations, visual findings, and named entities using the saved example configurations. Run one research PDF or the full four-paper corpus, then inspect the JSON you could use for retrieval or a knowledge graph. Start with the installation and GROBID setup.

OpenRouter

The ready-to-use OpenRouter configuration contains:

json
{
  "base_url": "https://openrouter.ai/api/v1",
  "model": "deepseek/deepseek-v4.1-flash",
  "api_key_env": "OPENAI_API_KEY",
  "temperature": 0,
  "workers": 1,
  "extra_body": {
    "reasoning": {
      "enabled": false
    },
    "provider": {
      "only": ["deepseek"],
      "allow_fallbacks": false
    }
  },
  "cost_path": ["usage", "cost"],
  "grobid_url": "http://127.0.0.1:8070"
}

reasoning.enabled: false prevents OpenRouter from enabling reasoning tokens for this model. provider.only restricts requests to the DeepSeek provider, and allow_fallbacks: false prevents routing to another provider. Remove the provider object if provider fallback is preferable. cost_path maps OpenRouter's per-request USD cost into report.json.

After running the installation, single-paper download, and GROBID setup from the main quick start, set OPENAI_API_KEY to an OpenRouter key and run:

sh
uv run distils-render --input examples/pdfs/2305.13245v3.pdf \
  --run-id openrouter-deepseek
uv run distils-run \
  --config examples/configs/openrouter-deepseek-v4.1-flash.json \
  --run runs/openrouter-deepseek

OrcaRouter

The archived measurements used deepseek/deepseek-v4.1-flash through https://api.orcarouter.ai/v1, with thinking disabled and one document worker. The two configurations differ only in temperature:

RunConfigurationTemperature
DeepSeek T=0configs/deepseek-t0.json0
DeepSeek T=1configs/deepseek-t1.json1

From the repository root, install dependencies and download the four PDFs; the downloader verifies their checksums:

sh
uv sync
uv run python examples/download.py --all

Start GROBID at http://127.0.0.1:8070.

The following commands rerun both configurations on the same four papers. Rendering explicitly uses the archived settings: 200 DPI, a maximum image edge of 2,000 pixels, and JPEG quality 92. Separate run directories give each experiment fresh GROBID processing and its own checkpoints.

sh
uv run distils-render --input examples/pdfs --run-id deepseek-t0 \
  --dpi 200 --max-long-edge 2000 --quality 92
uv run distils-run --config examples/configs/deepseek-t0.json --run runs/deepseek-t0

uv run distils-render --input examples/pdfs --run-id deepseek-t1 \
  --dpi 200 --max-long-edge 2000 --quality 92
uv run distils-run --config examples/configs/deepseek-t1.json --run runs/deepseek-t1

Released under the Apache License 2.0.