Skip to content

vlm-run/vlmrun-python-sdk

Repository files navigation

VLM Run Logo

Python SDK

Website | Platform | Docs | Blog | Discord

PyPI Version PyPI Version PyPI Downloads
License Discord Twitter Follow

The VLM Run Python SDK is the official Python SDK for VLM Run API platform, providing a convenient way to interact with our REST APIs.

🚀 Getting Started

Installation

pip install vlmrun

Installation with Optional Features

The package provides optional features that can be installed based on your needs:

  • Video processing features (numpy, opencv-python):

    pip install "vlmrun[video]"
  • Document processing features (pypdfium2):

    pip install "vlmrun[doc]"
  • All optional features:

    pip install "vlmrun[all]"

Basic Usage

from PIL import Image
from vlmrun.client import VLMRun
from vlmrun.client.types import GenerationConfig
from vlmrun.hub.schemas.document.invoice import Invoice

# Initialize the client
client = VLMRun(api_key="your-api-key")

# Process an image
image: Image.Image = Image.open("image.jpg")
response = client.image.generate(
    images=[image],
    model="vlm-1",
    domain="document.invoice",
    config=GenerationConfig(json_schema=Invoice.model_json_schema()),
)
print(response)

🔗 Quick Links

Contributors 7