# Provider Config Examples

These example configs match the production-oriented provider templates documented in the core README.

Available files:

- `native-tesseract-openrouter.mjs`: native Tesseract OCR with OpenRouter-backed LLM enrichment
- `tesseract-js-openrouter.mjs`: JavaScript Tesseract OCR with OpenRouter-backed LLM enrichment
- `ollama-local.mjs`: fully local Ollama OCR and LLM setup
- `claude-direct.mjs`: direct Claude OCR and LLM setup
- `openrouter-hosted.mjs`: hosted OpenRouter OCR and LLM setup
- `organization-gateway-openai.mjs`: organization-managed OpenAI-compatible gateway for OCR and LLM
- `provider-example.env`: sample environment variables used by the examples

Typical workflows:

```bash
# Run these from the docparser-core package root or an installed package directory.

# Preflight providers before processing documents
npx docparser health --config ./examples/configs/openrouter-hosted.mjs

# Process a document with one of the example configs
npx docparser process ./examples/inputs/report.md \
  --config ./examples/configs/openrouter-hosted.mjs

# OCR a checked-in sample form image with the hosted OpenRouter config
npx docparser process ./examples/inputs/renewal-form.png \
  --config ./examples/configs/openrouter-hosted.mjs \
  --format json \
  --quiet

# OCR the same sample form with the native Tesseract + OpenRouter config
npx docparser process ./examples/inputs/renewal-form.png \
  --config ./examples/configs/native-tesseract-openrouter.mjs \
  --format json \
  --quiet

# OCR the same sample form with the Tesseract.js + OpenRouter config
npx docparser process ./examples/inputs/renewal-form.png \
  --config ./examples/configs/tesseract-js-openrouter.mjs \
  --format json \
  --quiet

# OCR the same sample form with the fully local Ollama config
npx docparser process ./examples/inputs/renewal-form.png \
  --config ./examples/configs/ollama-local.mjs \
  --format json \
  --quiet

# OCR the same sample form with the direct Claude config
npx docparser process ./examples/inputs/renewal-form.png \
  --config ./examples/configs/claude-direct.mjs \
  --format json \
  --quiet

# OCR the same sample form with the organization-managed gateway config
npx docparser process ./examples/inputs/renewal-form.png \
  --config ./examples/configs/organization-gateway-openai.mjs \
  --format json \
  --quiet

# OCR a checked-in image-only PDF through the PDF rasterization fallback path
npx docparser process ./examples/inputs/renewal-scan.pdf \
  --config ./examples/configs/openrouter-hosted.mjs \
  --format json \
  --quiet
```

You can swap `./examples/inputs/renewal-scan.pdf` into any of these commands when you want to exercise the same OCR providers through the image-only PDF rasterization path.

Copy values from `provider-example.env` into `.env.local` in the directory where you run the CLI, then fill in the provider-specific secrets and endpoints you need.