Skip to main content

Official Python SDK for VLM Run

Project description

VLM Run Logo

VLM Run 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:

  • Chat with Orion via the CLI (see vlmrun chat)

    pip install "vlmrun[cli]"
    
  • Video processing features (numpy, opencv-python):

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

    pip install "vlmrun[doc]"
    
  • OpenAI SDK integration (for chat completions API):

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

    pip install "vlmrun[all]"
    

Basic Usage

from PIL import Image
from vlmrun.client import VLMRun
from vlmrun.common.utils import remote_image

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

# Process an image using local file or remote URL
image: Image.Image = remote_image("https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.invoice/invoice_1.jpg")
response = client.image.generate(
    images=[image],
    domain="document.invoice"
)
print(response)

# Or process an image directly from URL
response = client.image.generate(
    urls=["https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.invoice/invoice_1.jpg"],
    domain="document.invoice"
)
print(response)

OpenAI-Compatible Chat Completions

The VLM Run SDK provides OpenAI-compatible chat completions through the agent endpoint. This allows you to use the familiar OpenAI API with VLM Run's powerful vision-language models.

from vlmrun.client import VLMRun

client = VLMRun(
    api_key="your-key",
    base_url="https://api.vlm.run/v1"
)

response = client.agent.completions.create(
    model="vlmrun-orion-1",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)
print(response.choices[0].message.content)

For async support:

import asyncio
from vlmrun.client import VLMRun

client = VLMRun(api_key="your-key", base_url="https://api.vlm.run/v1")

async def main():
    response = await client.agent.async_completions.create(
        model="vlmrun-orion-1",
        messages=[{"role": "user", "content": "Hello!"}]
    )
    print(response.choices[0].message.content)

asyncio.run(main())

Installation: Install with OpenAI support using pip install vlmrun[openai]

CLI Chat with Skills

The vlmrun chat command supports skills — local directories containing a SKILL.md and optional assets that give the agent domain-specific expertise. Skills are sent inline with each request (no server-side upload required).

# Chat with an inline skill
vlmrun chat "Generate a youtube thumbnail for a video using the VLM Run brand colors" -k ./path/to/vlmrun-branding/

# Attach multiple skills (coming soon)
vlmrun chat "Analyze this invoice" -i invoice.pdf -k ./accounting-skills/ -k ./invoice-extraction/

To create a persistent server-side skill, use vlmrun skills upload ./my-skill/.

Claude Code

Install the VLM Run CLI skill directly in Claude Code via the plugin marketplace in the vlm-run/skills repository:

  1. Register the repository as a plugin marketplace:
/plugin marketplace add vlm-run/skills
  1. Install the skill:
/plugin install vlmrun-cli-skill@vlm-run/skills
  1. Configure your API key and base URL using the CLI (get your key from app.vlm.run):
vlmrun config init
vlmrun config set --api-key <your-api-key>
vlmrun config show
  1. Verify the skill is loaded by asking Claude Code (requires restart):
What skills are available in the /vlmrun-cli-skill?

🔗 Quick Links

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

vlmrun-0.6.0.tar.gz (90.5 kB view details)

Uploaded Source

Built Distribution

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

vlmrun-0.6.0-py3-none-any.whl (96.8 kB view details)

Uploaded Python 3

File details

Details for the file vlmrun-0.6.0.tar.gz.

File metadata

  • Download URL: vlmrun-0.6.0.tar.gz
  • Upload date:
  • Size: 90.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vlmrun-0.6.0.tar.gz
Algorithm Hash digest
SHA256 d32ed843b70a6901b6c40a3c3b7a55ae6c528fa5ad1c9856242ede2455be8fcc
MD5 4a63bf3a14480a723f4d463ffc28a148
BLAKE2b-256 5bc97a0b4e83c15f3ba9e213a1b485a560a0633d00c83ab1da274cbc349a2c48

See more details on using hashes here.

File details

Details for the file vlmrun-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: vlmrun-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 96.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vlmrun-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e81dcc05cee42189e63c872daae25ce7d12c04be1cc44086db18c24f0940fdb
MD5 8d3ab94970e2025e42f84706d7b7bace
BLAKE2b-256 911379498726d4554816c1db7a2b2260711efa7ca9fb48d4e1e39e398ecf7c0c

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