From 9e5c85a0dc1560bbd555ac10df880d00bda9cd70 Mon Sep 17 00:00:00 2001 From: Ritwij Aryan Parmar Date: Sat, 6 Jun 2026 17:27:50 -0400 Subject: [PATCH 1/2] Expose VLMRun at package top level --- README.md | 6 +++--- tests/test_client.py | 12 ++++++++++++ vlmrun/__init__.py | 12 ++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 vlmrun/__init__.py diff --git a/README.md b/README.md index ceedac4..9525abe 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The package provides optional features that can be installed based on your needs ```python from PIL import Image -from vlmrun.client import VLMRun +from vlmrun import VLMRun from vlmrun.common.utils import remote_image # Initialize the client @@ -86,7 +86,7 @@ print(response) 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. ```python -from vlmrun.client import VLMRun +from vlmrun import VLMRun client = VLMRun( api_key="your-key", @@ -106,7 +106,7 @@ For async support: ```python import asyncio -from vlmrun.client import VLMRun +from vlmrun import VLMRun client = VLMRun(api_key="your-key", base_url="https://api.vlm.run/v1") diff --git a/tests/test_client.py b/tests/test_client.py index f70dc44..8e5db7e 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -7,6 +7,18 @@ from vlmrun.client.exceptions import ConfigurationError, AuthenticationError +def test_top_level_client_import(): + """Test that the public package exposes the main client.""" + from vlmrun import VLMRun as TopLevelVLMRun + from vlmrun import __version__ + import vlmrun + + assert TopLevelVLMRun is VLMRun + assert vlmrun.VLMRun is VLMRun + assert isinstance(__version__, str) + assert "VLMRun" in vlmrun.__all__ + + def test_client_with_api_key(monkeypatch): """Test client initialization with API key provided in constructor.""" monkeypatch.delenv("VLMRUN_API_KEY", raising=False) diff --git a/vlmrun/__init__.py b/vlmrun/__init__.py new file mode 100644 index 0000000..407de77 --- /dev/null +++ b/vlmrun/__init__.py @@ -0,0 +1,12 @@ +"""Public package interface for the VLM Run Python SDK.""" + +from __future__ import annotations + +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) + +from vlmrun.client import VLMRun +from vlmrun.version import __version__ + +__all__ = ["VLMRun", "__version__"] From 8f82807ae4f64e6fbc412c244392e8dc9ef103c2 Mon Sep 17 00:00:00 2001 From: Ritwij Aryan Parmar Date: Sun, 7 Jun 2026 12:13:09 -0400 Subject: [PATCH 2/2] fix: remove legacy namespace package setup --- vlmrun/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vlmrun/__init__.py b/vlmrun/__init__.py index 407de77..8ada3b1 100644 --- a/vlmrun/__init__.py +++ b/vlmrun/__init__.py @@ -2,10 +2,6 @@ from __future__ import annotations -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - from vlmrun.client import VLMRun from vlmrun.version import __version__