{"id":30272100,"url":"https://github.com/0xcryptoangel/llm-pdf-extraction","last_synced_at":"2025-08-16T05:13:36.358Z","repository":{"id":307210956,"uuid":"1028718888","full_name":"0xCryptoAngel/LLM-pdf-extraction","owner":"0xCryptoAngel","description":"This project provides an API for uploading PDF documents and extracting structured summaries using either OpenAI's GPT-4o or Anthropic's Claude models. It is optimized for environmental and agricultural reports, transforming unstructured PDF content into structured JSON for downstream use.","archived":false,"fork":false,"pushed_at":"2025-07-30T01:10:56.000Z","size":68,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T03:46:01.681Z","etag":null,"topics":["bun","claude-api","llm-agent","machine-learning","nodejs","openai-chatgpt","react","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xCryptoAngel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-30T00:54:10.000Z","updated_at":"2025-07-30T01:18:22.000Z","dependencies_parsed_at":"2025-07-30T03:46:03.132Z","dependency_job_id":"8e3ef038-1a75-4671-b1dd-75d88fe9ebec","html_url":"https://github.com/0xCryptoAngel/LLM-pdf-extraction","commit_stats":null,"previous_names":["0xcryptoangel/llm-pdf-extraction"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/0xCryptoAngel/LLM-pdf-extraction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCryptoAngel%2FLLM-pdf-extraction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCryptoAngel%2FLLM-pdf-extraction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCryptoAngel%2FLLM-pdf-extraction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCryptoAngel%2FLLM-pdf-extraction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xCryptoAngel","download_url":"https://codeload.github.com/0xCryptoAngel/LLM-pdf-extraction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCryptoAngel%2FLLM-pdf-extraction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270670063,"owners_count":24625444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","claude-api","llm-agent","machine-learning","nodejs","openai-chatgpt","react","tailwindcss","typescript"],"created_at":"2025-08-16T05:13:35.763Z","updated_at":"2025-08-16T05:13:36.349Z","avatar_url":"https://github.com/0xCryptoAngel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDF Summary Extraction API\n\nThis project provides an API for uploading PDF documents and extracting structured summaries using either OpenAI's GPT-4o or Anthropic's Claude models. It is optimized for environmental and agricultural reports, transforming unstructured PDF content into structured JSON for downstream use.\n\n---\n\n## 🛠️ Tech Stack\n\n- **Framework**: Node.js with Express\n- **PDF Parsing**: `pdf-parse`\n- **LLM Integration**: OpenAI GPT-4o and Claude Opus 4\n- **Storage**: In-memory via Multer\n- **Language**: TypeScript\n\n---\n\n## 🚀 Features\n\n- Upload a PDF and extract structured data in a single API call\n- Choose between OpenAI or Claude as LLM provider\n- Validates and cleans JSON response for consistent schema\n- Returns fallback empty structure in case of model or parsing failure\n\n---\n\n## 📦 Setup Instructions\n\n1. **Clone the Repository**\n   ```bash\n   git clone https://github.com/your-org/pdf-extractor.git\n   cd pdf-extractor\n   ```\n\n2. **Install Dependencies**\n   ```bash\n   npm install\n   ```\n\n3. **Environment Configuration**\n   Create a `.env` file:\n   ```\n   OPENAI_API_KEY=your_openai_key\n   ANTHROPIC_API_KEY=your_claude_key\n   ```\n\n4. **Run the Server**\n   ```bash\n   npm run dev\n   ```\n\n---\n\n## 🧪 API Usage\n\n### POST `/upload`\n\nUpload a PDF and extract a summary:\n\n#### Form Data:\n- `file`: PDF file (multipart/form-data)\n\n#### Optional Query:\n- `provider`: `openai` (default) or `claude`\n\n#### Example with cURL:\n```bash\ncurl -X POST http://localhost:3000/upload?provider=claude   -F \"file=@./sample.pdf\"\n```\n\n---\n\n## 📁 Folder Structure\n\n```\n├── routes/\n│   └── upload.ts       → Express route for file upload\n├── services/\n│   ├── pdfService.ts   → PDF parsing logic\n│   └── llmService.ts   → LLM integration (OpenAI \u0026 Claude)\n├── utils/\n│   ├── types.ts        → ExtractedReport interface\n│   └── constants.ts    → Prompt templates\n├── .env\n├── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xcryptoangel%2Fllm-pdf-extraction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xcryptoangel%2Fllm-pdf-extraction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xcryptoangel%2Fllm-pdf-extraction/lists"}