GraySoft
Projects Models About FAQ Contact Download guIDE →
Model Intelligence Sheet

unsloth/nanonets-ocr-s-gguf overview

Unsloth Dynamic 2.0 achieves superior accuracy & outperforms other leading quants. Nanonets-OCR-s is a powerful, state-of-the-art image-to-markdown OCR model that goes far beyond traditional text extraction. It transforms documents into structured markdown with intelligent content recognition and semantic tagging, making it ideal for downstream processing by Large Language Models (LLMs). Nanonets-OCR-s is packed with features designed to handle complex documents with ease: LaTeX Equation Recognition: Automatically converts mathematical equations and formulas into properly formatted LaTeX syntax. It distinguishes between inline ($...$) and display ($$...$$) equations. Intelligent Image Description: Describes images within documents using structured tags, making them digestible for LLM processing. It can describe various image types, including logos, charts, graphs and so on, detailing their content, style, and context. Signature Detection & Isolation: Identifies and isolates signatures from other text, outputting them within a tag. This is crucial for processing legal and business documents. Watermark Extraction: Detects and extracts watermark text from documents, placing it within a tag. Smart Checkbox Handling: Converts form checkboxes and radio buttons into standardized Unicode symbols (☐, ☑, ☒) for consistent and reliable processing. Complex Table Extraction: Accurately extracts complex tables from documents and converts them into both markdown and HTML table formats. 📢 Read the full announcement | 🤗 Hugging Face Space Demo

transformersggufOCRunslothpdf2markdownimage-text-to-textenbase_model:nanonets/Nanonets-OCR-sbase_model:quantized:nanonets/Nanonets-OCR-sendpoints_compatibleregion:usconversational
unsloth/nanonets-ocr-s-gguf visual
Downloads
4,641
Likes
61
Pipeline
image-text-to-text
Library
transformers
Visibility
Public
Access
Open

Repository Files & Downloads

29 files detected
Direct downloads for all repository files
FileTypeQuantizationSizeLink
Nanonets-OCR-s-BF16.gguf GGUF BF16 5.75 GB Download
Nanonets-OCR-s-IQ4_NL.gguf GGUF IQ4_NL 1.70 GB Download
Nanonets-OCR-s-IQ4_XS.gguf GGUF IQ4_XS 1.62 GB Download
Nanonets-OCR-s-Q2_K.gguf GGUF Q2_K 1.19 GB Download
Nanonets-OCR-s-Q2_K_L.gguf GGUF Q2_K_L 1.19 GB Download
Nanonets-OCR-s-Q3_K_M.gguf GGUF Q3_K_M 1.48 GB Download
Nanonets-OCR-s-Q3_K_S.gguf GGUF Q3_K_S 1.35 GB Download
Nanonets-OCR-s-Q4_0.gguf GGUF 1.70 GB Download
Nanonets-OCR-s-Q4_1.gguf GGUF 1.86 GB Download
Nanonets-OCR-s-Q4_K_M.gguf GGUF Q4_K_M 1.80 GB Download
Nanonets-OCR-s-Q4_K_S.gguf GGUF Q4_K_S 1.71 GB Download
Nanonets-OCR-s-Q5_K_M.gguf GGUF Q5_K_M 2.07 GB Download
Nanonets-OCR-s-Q5_K_S.gguf GGUF Q5_K_S 2.02 GB Download
Nanonets-OCR-s-Q6_K.gguf GGUF Q6_K 2.36 GB Download
Nanonets-OCR-s-Q8_0.gguf GGUF 3.06 GB Download
Nanonets-OCR-s-UD-IQ1_M.gguf GGUF IQ1_M 840.80 MB Download
Nanonets-OCR-s-UD-IQ1_S.gguf GGUF IQ1_S 788.06 MB Download
Nanonets-OCR-s-UD-IQ2_M.gguf GGUF IQ2_M 1.09 GB Download
Nanonets-OCR-s-UD-IQ2_XXS.gguf GGUF IQ2_XXS 925.72 MB Download
Nanonets-OCR-s-UD-IQ3_XXS.gguf GGUF IQ3_XXS 1.21 GB Download
Nanonets-OCR-s-UD-Q2_K_XL.gguf GGUF Q2_K_XL 1.22 GB Download
Nanonets-OCR-s-UD-Q3_K_XL.gguf GGUF Q3_K_XL 1.52 GB Download
Nanonets-OCR-s-UD-Q4_K_XL.gguf GGUF Q4_K_XL 1.82 GB Download
Nanonets-OCR-s-UD-Q5_K_XL.gguf GGUF Q5_K_XL 2.08 GB Download
Nanonets-OCR-s-UD-Q6_K_XL.gguf GGUF Q6_K_XL 2.58 GB Download
Nanonets-OCR-s-UD-Q8_K_XL.gguf GGUF Q8_K_XL 3.66 GB Download
mmproj-BF16.gguf GGUF BF16 1.25 GB Download
mmproj-F16.gguf GGUF F16 1.25 GB Download
mmproj-F32.gguf GGUF F32 2.49 GB Download

Model Details Live

Model Slug
unsloth/nanonets-ocr-s-gguf
Author
unsloth
Pipeline Task
image-text-to-text
Library
transformers
Created
2025-06-16
Last Modified
2025-07-03
Gated
No
Private
No
HF SHA
e1970a8d538c03d5bfd7ca05bdb1a87864a0a4fc
License
Unknown
Language
en
Base Model
nanonets/Nanonets-OCR-s

Metadata Inspector

Normalized metadata (stored in metadata_json)
{
  "metadata": {},
  "card_data": {
    "language": [
      "en"
    ],
    "base_model": [
      "nanonets/Nanonets-OCR-s"
    ],
    "pipeline_tag": "image-text-to-text",
    "tags": [
      "OCR",
      "unsloth",
      "pdf2markdown"
    ],
    "library_name": "transformers",
    "frontmatter": {
      "language": [
        "en"
      ],
      "base_model": [
        "nanonets/Nanonets-OCR-s"
      ],
      "pipeline_tag": "image-text-to-text",
      "tags": [
        "OCR",
        "unsloth",
        "pdf2markdown"
      ],
      "library_name": "transformers"
    },
    "hero_image_url": "https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png",
    "summary": "Unsloth Dynamic 2.0 achieves superior accuracy & outperforms other leading quants.              Nanonets-OCR-s is a powerful, state-of-the-art image-to-markdown OCR model that goes far beyond traditional text extraction. It transforms documents into structured markdown with intelligent content recognition and semantic tagging, making it ideal for downstream processing by Large Language Models (LLMs). Nanonets-OCR-s is packed with features designed to handle complex documents with ease: * **LaTeX Equation Recognition:** Automatically converts mathematical equations and formulas into properly formatted LaTeX syntax. It distinguishes between inline ($...$) and display ($$...$$) equations. * **Intelligent Image Description:** Describes images within documents using structured  tags, making them digestible for LLM processing. It can describe various image types, including logos, charts, graphs and so on, detailing their content, style, and context. * **Signature Detection & Isolation:** Identifies and isolates signatures from other text, outputting them within a  tag. This is crucial for processing legal and business documents. * **Watermark Extraction:** Detects and extracts watermark text from documents, placing it within a  tag. * **Smart Checkbox Handling:** Converts form checkboxes and radio buttons into standardized Unicode symbols (☐, ☑, ☒) for consistent and reliable processing. * **Complex Table Extraction:** Accurately extracts complex tables from documents and converts them into both markdown and HTML table formats. 📢 Read the full announcement | 🤗 Hugging Face Space Demo",
    "quick_links": [],
    "benchmark_table_html": "",
    "readme_markdown": "---\nlanguage:\n- en\nbase_model:\n- nanonets/Nanonets-OCR-s\npipeline_tag: image-text-to-text\ntags:\n- OCR\n- unsloth\n- pdf2markdown\nlibrary_name: transformers\n---\n<div>\n<p style=\"margin-top: 0;margin-bottom: 0;\">\n    <em><a href=\"https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf\">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>\n  </p>\n  <div style=\"display: flex; gap: 5px; align-items: center; \">\n    <a href=\"https://github.com/unslothai/unsloth/\">\n      <img src=\"https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png\" width=\"133\">\n    </a>\n    <a href=\"https://discord.gg/unsloth\">\n      <img src=\"https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png\" width=\"173\">\n    </a>\n    <a href=\"https://docs.unsloth.ai/basics/qwen3-how-to-run-and-fine-tune\">\n      <img src=\"https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png\" width=\"143\">\n    </a>\n  </div>\n</div>\n\n\n\nNanonets-OCR-s is a powerful, state-of-the-art image-to-markdown OCR model that goes far beyond traditional text extraction. It transforms documents into structured markdown with intelligent content recognition and semantic tagging, making it ideal for downstream processing by Large Language Models (LLMs).\n\nNanonets-OCR-s is packed with features designed to handle complex documents with ease:\n\n* **LaTeX Equation Recognition:** Automatically converts mathematical equations and formulas into properly formatted LaTeX syntax. It distinguishes between inline (`$...$`) and display (`$$...$$`) equations.\n* **Intelligent Image Description:** Describes images within documents using structured `<img>` tags, making them digestible for LLM processing. It can describe various image types, including logos, charts, graphs and so on, detailing their content, style, and context.\n* **Signature Detection & Isolation:** Identifies and isolates signatures from other text, outputting them within a `<signature>` tag. This is crucial for processing legal and business documents.\n* **Watermark Extraction:** Detects and extracts watermark text from documents, placing it within a `<watermark>` tag.\n* **Smart Checkbox Handling:** Converts form checkboxes and radio buttons into standardized Unicode symbols (`☐`, `☑`, `☒`) for consistent and reliable processing.\n* **Complex Table Extraction:** Accurately extracts complex tables from documents and converts them into both markdown and HTML table formats.\n\n\n📢 [Read the full announcement](https://nanonets.com/research/nanonets-ocr-s) | 🤗 [Hugging Face Space Demo](https://huggingface.co/spaces/Souvik3333/Nanonets-ocr-s)\n\n## Usage\n### Using transformers\n```python\nfrom PIL import Image\nfrom transformers import AutoTokenizer, AutoProcessor, AutoModelForImageTextToText\n\nmodel_path = \"nanonets/Nanonets-OCR-s\"\n\nmodel = AutoModelForImageTextToText.from_pretrained(\n    model_path, \n    torch_dtype=\"auto\", \n    device_map=\"auto\", \n    attn_implementation=\"flash_attention_2\"\n)\nmodel.eval()\n\ntokenizer = AutoTokenizer.from_pretrained(model_path)\nprocessor = AutoProcessor.from_pretrained(model_path)\n\n\ndef ocr_page_with_nanonets_s(image_path, model, processor, max_new_tokens=4096):\n    prompt = \"\"\"Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation. If there is an image in the document and image caption is not present, add a small description of the image inside the <img></img> tag; otherwise, add the image caption inside <img></img>. Watermarks should be wrapped in brackets. Ex: <watermark>OFFICIAL COPY</watermark>. Page numbers should be wrapped in brackets. Ex: <page_number>14</page_number> or <page_number>9/22</page_number>. Prefer using ☐ and ☑ for check boxes.\"\"\"\n    image = Image.open(image_path)\n    messages = [\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": [\n            {\"type\": \"image\", \"image\": f\"file://{image_path}\"},\n            {\"type\": \"text\", \"text\": prompt},\n        ]},\n    ]\n    text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)\n    inputs = processor(text=[text], images=[image], padding=True, return_tensors=\"pt\")\n    inputs = inputs.to(model.device)\n    \n    output_ids = model.generate(**inputs, max_new_tokens=max_new_tokens, do_sample=False)\n    generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(inputs.input_ids, output_ids)]\n    \n    output_text = processor.batch_decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True)\n    return output_text[0]\n\nimage_path = \"/path/to/your/document.jpg\"\nresult = ocr_page_with_nanonets_s(image_path, model, processor, max_new_tokens=15000)\nprint(result)\n```\n\n### Using vLLM\n1. Start the vLLM server.\n```bash\nvllm serve nanonets/Nanonets-OCR-s\n```\n2. Predict with the model\n```python\nfrom openai import OpenAI\nimport base64\n\nclient = OpenAI(api_key=\"123\", base_url=\"http://localhost:8000/v1\")\n\nmodel = \"nanonets/Nanonets-OCR-s\"\n\ndef encode_image(image_path):\n    with open(image_path, \"rb\") as image_file:\n        return base64.b64encode(image_file.read()).decode(\"utf-8\")\n\ndef ocr_page_with_nanonets_s(img_base64):\n    response = client.chat.completions.create(\n        model=model,\n        messages=[\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\n                        \"type\": \"image_url\",\n                        \"image_url\": {\"url\": f\"data:image/png;base64,{img_base64}\"},\n                    },\n                    {\n                        \"type\": \"text\",\n                        \"text\": \"Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation. If there is an image in the document and image caption is not present, add a small description of the image inside the <img></img> tag; otherwise, add the image caption inside <img></img>. Watermarks should be wrapped in brackets. Ex: <watermark>OFFICIAL COPY</watermark>. Page numbers should be wrapped in brackets. Ex: <page_number>14</page_number> or <page_number>9/22</page_number>. Prefer using ☐ and ☑ for check boxes.\",\n                    },\n                ],\n            }\n        ],\n        temperature=0.0,\n        max_tokens=15000\n    )\n    return response.choices[0].message.content\n\ntest_img_path = \"/path/to/your/document.jpg\"\nimg_base64 = encode_image(test_img_path)\nprint(ocr_page_with_nanonets_s(img_base64))\n```\n\n### Using docext\n```python\npip install docext\npython -m docext.app.app --model_name hosted_vllm/nanonets/Nanonets-OCR-s\n```\nCheckout [GitHub](https://github.com/NanoNets/docext/tree/dev/markdown) for more details.\n\n\n## BibTex\n```\n@misc{Nanonets-OCR-S,\n  title={Nanonets-OCR-S: A model for transforming documents into structured markdown with intelligent content recognition and semantic tagging},\n  author={Souvik Mandal and Ashish Talewar and Paras Ahuja and Prathamesh Juvatkar},\n  year={2025},\n}\n```",
    "related_quantizations": []
  },
  "tags": [
    "transformers",
    "gguf",
    "OCR",
    "unsloth",
    "pdf2markdown",
    "image-text-to-text",
    "en",
    "base_model:nanonets/Nanonets-OCR-s",
    "base_model:quantized:nanonets/Nanonets-OCR-s",
    "endpoints_compatible",
    "region:us",
    "conversational"
  ],
  "likes": 61,
  "downloads": 4641,
  "gated": false,
  "private": false,
  "last_modified": "2025-07-03T12:22:50.000Z",
  "created_at": "2025-06-16T10:35:11.000Z",
  "pipeline_tag": "image-text-to-text",
  "library_name": "transformers"
}
Source payload excerpt (from Hugging Face API)
{
  "_id": "684ff35f75d44a9b5e97ca1a",
  "id": "unsloth/Nanonets-OCR-s-GGUF",
  "modelId": "unsloth/Nanonets-OCR-s-GGUF",
  "sha": "e1970a8d538c03d5bfd7ca05bdb1a87864a0a4fc",
  "createdAt": "2025-06-16T10:35:11.000Z",
  "lastModified": "2025-07-03T12:22:50.000Z",
  "author": "unsloth",
  "downloads": 4641,
  "likes": 61,
  "gated": false,
  "private": false,
  "pipeline_tag": "image-text-to-text",
  "library_name": "transformers",
  "siblings_count": 35
}