Skip to main content

Docling plugin for LiteLLM picture description

Project description

Docling LiteLLM Picture Description Plugin

This plugin allows you to use the LiteLLM library for generating picture descriptions in your Docling pipeline. This plugin will allow you to use Vision LLM from any external providers supported by LiteLLM, such as OpenAI, Azure OpenAI, Vertex AI, and xAI.

Installation

pip install docling-litellm-picture-description

Usage

from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling_litellm_picture_description.datamodel.pipeline_options import PictureDescriptionLiteLLMOptions

picture_description_options = PictureDescriptionApiOptions(
    model=self.model_name,
    prompt="Describe the picture in detail.",
    scale=1.0,
    timeout=120,
)
pipeline_options = PdfPipelineOptions(
    enable_remote_services=True,
    allow_external_plugins=True,
    do_picture_description=True,
    picture_description_options=picture_description_options,
    generate_picture_images=True,
)
converter = DocumentConverter(
    format_options={
        InputFormat.IMAGE: PdfFormatOption(
            pipeline_options=pipeline_options,
        ),
        InputFormat.PDF: PdfFormatOption(
            pipeline_options=pipeline_options,
        )
    }
)
doc = converter.convert(file).document
markdown_text = doc.export_to_markdown()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docling_litellm_picture_description-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file docling_litellm_picture_description-0.1.1.tar.gz.

File metadata

File hashes

Hashes for docling_litellm_picture_description-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5dd1dc9c408f393a22f32f996fb6deecb07c49cf7c242c94558038b37cd06228
MD5 365b54be3ab37d37a2c0dd189479a1f0
BLAKE2b-256 5c3e81e3727968bce650637ec3e1c350723a5d3c0eef648baf81160608912e80

See more details on using hashes here.

File details

Details for the file docling_litellm_picture_description-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for docling_litellm_picture_description-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba1820266879df27ca8088d3ff8acdd88fc55b65bf5580ccb40a1251f480dd10
MD5 5560ae8cb9731f4682615d0d3e819722
BLAKE2b-256 b8924ee1e7d8b9fde685fbab46ecd3c837ca24b862955584c2a139dedce07fb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page