The VLMRun client class is the main entry point for interacting with the VLM Run API.

Initialization

from vlmrun.client import VLMRun

client = VLMRun(api_key="your-api-key")  # Optional if VLMRUN_API_KEY env var is set

Components

The client provides access to various API components:

  • client.files - File upload and management
  • client.models - Model listing and information
  • client.hub - Domain and schema management
  • client.fine_tuning - Model fine-tuning

Prediction APIs

  • client.image - Image processing operations
  • client.document - Document processing
  • client.audio - Audio processing
  • client.video - Video processing

Health Check

Check API availability:

is_healthy = client.healthcheck()

Error Handling

The client raises appropriate exceptions for API errors:

try:
    response = client.models.list()
except Exception as e:
    print(f"Error: {e}")