npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docuglean-ocr

v1.0.0

Published

An SDK for intelligent document processing using State of the Art AI models.

Downloads

5

Readme

What is Docuglean AI?

Docuglean is a unified SDK for intelligent document processing using State of the Art AI models. Docuglean provides multilingual and multimodal capabilities with plug-and-play APIs for document OCR, structured data extraction, annotation, classification, summarization, and translation. It also comes with inbuilt tools and supports different types of documents out of the box.

Features

  • 🚀 Easy to Use: Simple, intuitive API with detailed documentation. Just pass in a file and get markdown in response.
  • 🔍 OCR Capabilities: Extract text from images and scanned documents
  • 📊 Structured Data Extraction: Use Zod schemas for type-safe data extraction
  • 📄 Multimodal Support: Process PDFs and images with ease
  • 🤖 Multiple AI Providers: Support for OpenAI, Mistral, and Google Gemini, with more coming soon
  • 🔒 Type Safety: Full TypeScript support with comprehensive types

Coming Soon

  • [ ] 📝 summarize(): TLDRs of long documents
  • [ ] 🌐 translate(): Support for multilingual documents
  • [ ] 🏷️ classify(): Document type classifier (receipt, ID, invoice, etc.)
  • [ ] 🔍 search(query): LLM-powered search across documents
  • [ ] 🤖 More Models. More Providers: Integration with Meta's Llama, Together AI, OpenRouter and lots more.
  • [ ] 🌍 Multilingual: Support for multiple languages (coming soon)
  • [ ] 🎯 Smart Classification: Automatic document type detection (coming soon)

Quick Start

Installation

npm i docuglean

Features in Detail

OCR Processing

import { ocr } from 'docuglean';

// Mistral OCR
const result = await ocr({
  filePath: './document.pdf',
  provider: 'mistral',
  model: 'mistral-ocr-latest',
  apiKey: 'your-api-key'
});

// Google Gemini OCR
const geminiResult = await ocr({
  filePath: './document.pdf',
  provider: 'gemini',
  model: 'gemini-2.5-flash',
  apiKey: 'your-gemini-api-key',
  prompt: 'Extract all text from this document'
});

Provider Options

Currently supported providers and models:

  • OpenAI: gpt-4.1-mini, gpt-4.1, gpt-4o-mini, gpt-4o, o1-mini, o1, o3, o4-mini
  • Mistral: mistral-ocr-latest for OCR. All currently available models except for codestral-mamba are supported for structured outputs.
  • Google Gemini: gemini-2.5-flash, gemini-2.5-pro, gemini-1.5-flash, gemini-1.5-pro
  • More coming soon: Together AI, OpenRouter, Anthropic etc

Configuration

OCR Configuration

interface OCRConfig {
  filePath: string;
  provider?: 'openai' | 'mistral' | 'gemini';
  model?: string;
  apiKey: string;
  prompt?: string;
  options?: {
    mistral?: {
      includeImageBase64?: boolean;
    };
    openai?: {
      maxTokens?: number;
    };
    gemini?: {
      temperature?: number;
      topP?: number;
      topK?: number;
    };
  };
}

Extraction Configuration

interface ExtractConfig {
  filePath: string;
  apiKey: string;
  provider?: 'openai' | 'mistral' | 'gemini';
  model?: string;
  prompt?: string;
  responseFormat?: z.ZodType<any>;
  systemPrompt?: string;
}

Basic Structured Output Usage

import { extract } from 'docuglean';
import { z } from 'zod';

// Define your schema (for structured extraction)
const Receipt = z.object({
  date: z.string(),
  total: z.number(),
  items: z.array(z.object({
    name: z.string(),
    price: z.number()
  }))
});

// Unstructured extraction
const text = await extract({
  filePath: './document.pdf',
  provider: 'mistral',
  apiKey: 'your-api-key',
  prompt: 'Summarize this document'
});

// Structured extraction with OpenAI
const receipt = await extract({
  filePath: './receipt.pdf',
  provider: 'openai',
  apiKey: 'your-api-key',
  responseFormat: Receipt,
  prompt: 'Extract receipt information'
});

// Structured extraction with Gemini
const geminiReceipt = await extract({
  filePath: './receipt.pdf',
  provider: 'gemini',
  apiKey: 'your-gemini-api-key',
  responseFormat: Receipt,
  prompt: 'Extract receipt information including date, total, and all items'
});

Check out our test folder for more comprehensive examples and use cases, including:

  • Receipt parsing
  • Document summarization
  • Image OCR
  • Structured data extraction
  • Custom schema validation

Stay Up to Date

⭐ Star this repo to get notified about new releases and updates!

Contributing

We welcome contributions! Please refer to the CONTRIBUTING.md file for information about how to get involved. We welcome issues, questions, and pull requests.

License

Apache 2.0 - see the LICENSE file for details.