openreader/compute-worker/.env.example
Richard R a56aaa2be9 Refactor PDF parsing and rendering logic; migrate to compute-worker protocol
- Removed deprecated functions related to document parsing and blob storage in blobstore.ts.
- Introduced new PDF rendering logic in pdf-preview-renderer.ts and pdf-preview-pdfjs-runtime.ts.
- Updated previews-render.ts to utilize the new PDF rendering functions.
- Refactored user-whisper-align-job.ts to use the compute-worker client for alignment requests.
- Enhanced artifact.ts and operation.ts to validate parsed PDF artifacts and resolve current PDF parses.
- Updated snapshot.ts to align with new worker operation types.
- Adjusted runtime-config.ts to check for compute-worker availability.
- Modified types in parsed-pdf.ts and tts.ts to reflect changes in the compute-worker protocol.
- Added unit tests for PDF artifact validation and compute-worker client contract.
- Removed obsolete pdf-op-key.vitest.spec.ts test file.
2026-06-12 13:43:33 -06:00

58 lines
2.1 KiB
Text

# External compute-worker service env only.
# Keep COMPUTE_WORKER_TOKEN and S3_* aligned with app env.
# In external worker mode, worker runtime vars live here (or worker platform env),
# not in the app/root `.env`.
# App/root `.env` should only set:
# - COMPUTE_WORKER_URL
# - COMPUTE_WORKER_TOKEN
# - optional shared timeout/stale overrides
# Details: docs/deploy/compute-worker
# Compute worker bind
# Platform note:
# - Local/manual: keep PORT=8081
# - Railway/Render/Fly/etc: platform injects PORT
# COMPUTE_WORKER_HOST=0.0.0.0
# PORT=8081
# LOG_FORMAT=pretty
# COMPUTE_LOG_LEVEL=info
# Must match app env when app uses COMPUTE_WORKER_URL
COMPUTE_WORKER_TOKEN=local-compute-token
# NATS/JetStream
NATS_URL=nats://nats:4222
# Optional: NATS authentication credentials (e.g. for Synadia Cloud / NGS)
# You can specify the file path:
# NATS_CREDS_FILE=/path/to/NGS-Default-compute-worker.creds
# Or specify the raw credentials string content (excellent for container/cloud platforms):
# NATS_CREDS="-----BEGIN NATS USER JWT-----\n...\n-----BEGIN USER NKEY SEED-----\n..."
# Shared object storage (must be reachable from worker)
S3_BUCKET=openreader-documents
S3_REGION=us-east-1
S3_ACCESS_KEY_ID=devkey
S3_SECRET_ACCESS_KEY=devsecret
# S3_PREFIX=openreader
# Optional for non-AWS S3-compatible endpoints:
S3_ENDPOINT=http://host.docker.internal:8333
S3_FORCE_PATH_STYLE=true
# Optional tuning
# COMPUTE_PREWARM_MODELS=false
# COMPUTE_JOB_CONCURRENCY=1
# COMPUTE_WHISPER_TIMEOUT_MS=30000
# COMPUTE_PDF_TIMEOUT_MS=300000
# COMPUTE_PDF_JOB_ATTEMPTS=1
# COMPUTE_JOBS_STREAM_MAX_BYTES=268435456
# COMPUTE_EVENTS_STREAM_MAX_BYTES=134217728
# COMPUTE_JOB_STATES_MAX_BYTES=67108864
# COMPUTE_NATS_REPLICAS=1
# COMPUTE_OP_STALE_MS=1800000
# Optional model mirrors
# Default expected Whisper variant is q4:
# - onnx/encoder_model_q4.onnx
# - onnx/decoder_model_merged_q4.onnx
# - onnx/decoder_with_past_model_q4.onnx
# WHISPER_MODEL_BASE_URL=https://huggingface.co/onnx-community/whisper-base_timestamped/resolve/main
# PDF_LAYOUT_MODEL_BASE_URL=https://huggingface.co/Bei0001/PP-DocLayoutV3-ONNX/resolve/main