Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gmicloud.ai/llms.txt

Use this file to discover all available pages before exploring further.

Model ID
allenai/olmOCR-2-7B-1025-FP8
This is a release of the olmOCR model that’s fine tuned from Qwen2.5-VL-7B-Instruct using the olmOCR-mix-1025 dataset. It has been additionally fine tuned using GRPO RL training to boost its performance at math equations, tables, and other tricky OCR cases.

API Usage

You can interact with the olmOCR-2-7B-1025 model through various programming languages and methods. Below are examples showing how to use the model’s API.

API Examples

Generate a model response using the chat endpoint of olmOCR-2-7B-1025.

Shell

curl https://api.gmi-serving.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer *************" \
    -d '{
  "model": "allenai/olmOCR-2-7B-1025-FP8",
  "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://olmocr.allenai.org/boxplotswhite-4t0gsafj.png"
            }
          }
        ]
      }
    ],
  "temperature": 0,
  "max_tokens": 500
}'

Python

import requests
import json

url = "https://api.gmi-serving.com/v1/chat/completions"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer *************"
}

payload = {
    "model": "allenai/olmOCR-2-7B-1025-FP8",
    "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "What is in this image?"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://olmocr.allenai.org/boxplotswhite-4t0gsafj.png"
              }
            }
          ]
        }
      ],
    "temperature": 0,
    "max_tokens": 500
}

response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))

Openai-python

import os
from openai import OpenAI

client = OpenAI(
  base_url="https://api.gmi-serving.com/v1",
  api_key="<GMI_API_KEY>",
)

completion = client.chat.completions.create(
  model="allenai/olmOCR-2-7B-1025-FP8",
  messages=[
              {
                "role": "user",
                "content": [
                  {
                    "type": "text",
                    "text": "What is in this image? give me more details"
                  },
                  {
                    "type": "image_url",
                    "image_url": {
                      "url": "https://olmocr.allenai.org/boxplotswhite-4t0gsafj.png"
                    }
                  }
                ]
              }
            ]
)

print(completion.choices[0].message.content)