Skip to main content

Plugin ocr_translate_ollama

This is a plugin for ocr_translate that implements translations through ollama using Large Language Models (LLM)s.

Usage

For versions of the server >=0.2

  • Install this by running pip install ocr_translate_ollama
  • Add ocr_translate_ollama to your INSTALLED_APPS in settings.py
  • Run the server with AUTOCREATE_VALIDATED_MODELS once

For versions of the server >=0.6

  • Install through the server plugin manager

For versions of the server >=0.7

  • Install through the server plugin manager OR manually by running pip install ocr_translate-google

Ollama name prefixes

To avoid cluttering the ollama server (or having to set a dedicated one), the plugin will create new models from the original one (with a dedicated system prompt) adding the prefix oct_ollama_ to the model names.

This behavior can be changed by setting the environment variable OCT_OLLAMA_PREFIX to a different value.

NOTE: The final _ is added by the plugin, so it should not be included in the prefix.

IMPORTANT

Ollama needs to be installed separately and reachable from the server (check the link for instructions). The environment variable OCT_OLLAMA_ENDPOINT should be set to the endpoint of the ollama server (including the /api).

Example:

export OLLAMA_ENDPOINT=http://localhost:11434/api

Depending on the RAM available on your system (CPU/GPU), you also may need to tune the variables

  • OLLAMA_MAX_LOADED_MODELS
  • OLLAMA_NUM_PARALLEL

when running the server.

For more information, check the ollama FAQ

Metadata

Release files for ocr_translate_ollama 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocr_translate_ollama 0.3.0
File Size Uploaded
ocr_translate_ollama-0.3.0.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocr_translate_ollama 0.3.0
File Interpreter ABI Platform
ocr_translate_ollama-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.9 kB

Release files / ocr_translate_ollama-0.3.0.tar.gz

Download URL ocr_translate_ollama-0.3.0.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
96461b8bb3ce95b03819ad4352bb3ab25ef97b625efe691e3d2c873a4ea36789
BLAKE2b-256 checksum
How to use checksums
991e88ae02e5291ac1f4cba5b37c9304f4d58bed78ad644518406699e3ad7749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release files / ocr_translate_ollama-0.3.0-py3-none-any.whl

Download URL ocr_translate_ollama-0.3.0-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
248bc799caaaa9617f31ea54dbb0f03d67978f5fa55e082628d662016a091f2e
BLAKE2b-256 checksum
How to use checksums
dd2c4f938631c57be7b8f922439da4446abeb97b68870132f62f8fe9a04912d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page