If you work with PDFs or scanned documents and need a reliable way to extract text, RolmOCR might just be your new favorite model. It’s a faster, lighter, and more efficient version of olmOCR, built using the Qwen2.5-VL-7B-Instruct vision-language model. Unlike the original, RolmOCR doesn’t rely on extra metadata, which helps reduce memory use and speed up processing, all without losing accuracy. It’s also trained to handle rotated documents better, making it more flexible for real-world use. RolmOCR strikes an ideal balance between performance and practicality, making it a solid fit for developers, researchers, and anyone dealing with tricky OCR tasks in real-world applications.
In this guide, you’ll learn the complete process to install and run RolmOCR locally, and then use it to extract text from messy images, so you can explore its speed and capabilities firsthand.
Prerequisites
The minimum system requirements for this use case are:
- GPUs: RTX 4090 or RTX A6000
- Disk Space: 100 GB
- RAM: At least 8 GB.
- Anaconda set up
Note: The prerequisites for this are highly variable across use cases. A high-end configuration could be used for a large-scale deployment.
Step-by-step process to install and run RolmOCR locally
For the purpose of this tutorial, we’ll use a GPU-powered Virtual Machine by NodeShift since it provides high compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. Also, it offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider of your choice and follow the same steps for the rest of the tutorial.
Step 1: Setting up a NodeShift Account
Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.
If you already have an account, login straight to your dashboard.
Step 2: Create a GPU Node
After accessing your account, you should see a dashboard (see image), now:
- Navigate to the menu on the left side.
- Click on the GPU Nodes option.
- Click on Start to start creating your very first GPU node.
These GPU nodes are GPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations for GPUs ranging from H100s to A100s, CPUs, RAM, and storage, according to your needs.
Step 3: Selecting configuration for GPU (model, region, storage)
- For this tutorial, we’ll be using the RTX 4090 GPU; however, you can choose any GPU of your choice based on your needs.
- Similarly, we’ll opt for 200GB storage by sliding the bar. You can also select the region where you want your GPU to reside from the available ones.
Step 4: Choose GPU Configuration and Authentication method
- After selecting your required configuration options, you’ll see the available GPU nodes in your region and according to (or very close to) your configuration. In our case, we’ll choose a 1x RTX A6000 48GB GPU node with 64vCPUs/63GB RAM/200GB SSD.
2. Next, you’ll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.
Step 5: Choose an Image
The final step would be to choose an image for the VM, which in our case is Nvidia Cuda, where we’ll deploy and run the inference of our model.
That’s it! You are now ready to deploy the node. Finalize the configuration summary, and if it looks good, click Create to deploy the node.
Step 6: Connect to active Compute Node using SSH
- As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!
- Once your GPU shows this status, navigate to the three dots on the right and click on Connect with SSH. This will open a pop-up box with the Host details. Copy and paste that in your local terminal to connect to the remote server via SSH.
As you copy the details, follow the below steps to connect to the running GPU VM via SSH:
- Open your terminal, paste the SSH command, and run it.
2. In some cases, your terminal may take your consent before connecting. Enter ‘yes’.
3. A prompt will request a password. Type the SSH password, and you should be connected.
Output:
Next, If you want to check the GPU details, run the following command in the terminal:
!nvidia-smi
Output:
Step 7: Set up the project environment with dependencies
- Create a virtual environment using Anaconda.
conda create -n rolmocr python=3.10 -y && conda activate rolmocr
Output:
2. Once you’re inside the environment, install project dependencies as mentioned in below.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install vllm huggingface_hub
Output:
3. Export VLLM endpoint and start the vllm server.
export VLLM_USE_V1=1
vllm serve reducto/RolmOCR
Output:
4. Verify if the model is accessible on the API endpoint using the following curl
command:
curl http://localhost:8000/v1/models
Output:
If the RolmOCR model is present in the output list, it means vllm
is successfully up and running and serving the model at this endpoint.
Step 8: Call the API for Model Inference
1. For running the model for inference, we’ll first create a new directory called ocr
.
mkdir ocr
Next, access this directory from inside the VS Code Editor, using which we’ll write the code for inference.
For this, if you’re using a remote server (e.g. NodeShift GPU), you’ll first need to connect your local VS Code editor to your remote server via SSH with the following steps:
a) Install the “Remote-SSH” Extension by Microsoft on VS Code.
b) Type “Remote-SSH: Connect to Host” on the Command Palette.
c) Enter the host details, such as username and SSH password, and you should be connected.
3. Create a file named app.py
in the root of the project and paste the below code snippet in the file.
from openai import OpenAI
import base64
client = OpenAI(api_key="123", base_url="http://localhost:8000/v1/")
model = "reducto/RolmOCR"
def encode_image(image_path):
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode("utf-8")
def ocr_page_with_rolm(img_base64):
response = client.chat.completions.create(
model=model,
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {"url": f"data:image/png;base64,{img_base64}"},
},
{
"type": "text",
"text": "Return the plain text representation of this document as if you were reading it naturally.\n",
},
],
}
],
temperature=0.2,
max_tokens=4096
)
return response.choices[0].message.content
test_img_path = "./handwriting.jpg"
img_base64 = encode_image(test_img_path)
print(ocr_page_with_rolm(img_base64))
The file looks like this:
In the above code we’re testing RolmOCR for the given handwriting image as shown below:
4. Run the app.py file in terminal.
python3 app.py
Output:
Conclusion
By now, you’ve seen how RolmOCR simplifies and speeds up OCR tasks by combining a powerful vision-language model with optimizations like reduced memory use and rotation-aware training. Running it locally gives you full control and flexibility, and when you’re ready to scale, NodeShift makes it even easier to deploy and manage models like RolmOCR in production. With seamless GPU access, pre-configured environments, and intuitive deployment interface, NodeShift helps you go from testing to real-world use in just a few clicks.