The client.files object allows you to upload and manage files for use with VLM Run.

Upload File

from vlmrun.client import VLMRun
from vlmrun.client.types import FileResponse

# Initialize the client
client = VLMRun()

# Upload a file
file_response: FileResponse = client.files.upload(
    file="path/to/file.jpg",  # File path or file-like object
    purpose="assistants"  # Purpose of the file (e.g. "assistants", "fine-tune", "datasets", "batch")
)

# Get file ID for later use
file_id = file_response.id

Get File

# Retrieve file information
file: FileResponse = client.files.get(file_id)

List Files

# List all files
files: List[FileResponse] = client.files.list()

# List files with filters
files: List[FileResponse] = client.files.list(limit=10)