From c0bb1b5d3d0f117924e9ee083ff0c9d9aa9a45b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Jan 2026 11:09:21 +0800 Subject: [PATCH 1/2] Fix macOS MPS compatibility in test server startup Add PYTORCH_ENABLE_MPS_FALLBACK=1 environment variable when starting test servers to allow PyTorch operations to fall back to CPU when MPS (Metal Performance Shaders) doesn't support them. This fixes test failures on macOS with Apple Silicon where operations like aten::linalg_cholesky_ex.L are not implemented for MPS device. --- tests/test_conversation_logging_server.py | 2 ++ tests/test_utils.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/test_conversation_logging_server.py b/tests/test_conversation_logging_server.py index 0fdf983..ef22803 100644 --- a/tests/test_conversation_logging_server.py +++ b/tests/test_conversation_logging_server.py @@ -94,6 +94,8 @@ def _start_server_with_logging(cls): env["OPTILLM_API_KEY"] = "optillm" env["OPTILLM_LOG_CONVERSATIONS"] = "true" env["OPTILLM_CONVERSATION_LOG_DIR"] = str(cls.temp_log_dir) + # Enable MPS fallback to CPU for unsupported operations (fixes macOS compatibility) + env["PYTORCH_ENABLE_MPS_FALLBACK"] = "1" # Get the project root directory (parent of tests directory) project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/tests/test_utils.py b/tests/test_utils.py index be99e19..30039a9 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -42,6 +42,8 @@ def start_test_server(model: str = TEST_MODEL, port: int = 8000) -> subprocess.P # Set environment for local inference env = os.environ.copy() env["OPTILLM_API_KEY"] = "optillm" + # Enable MPS fallback to CPU for unsupported operations (fixes macOS compatibility) + env["PYTORCH_ENABLE_MPS_FALLBACK"] = "1" # Get the project root directory (parent of tests directory) project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From ac5548e96d53616b2484da0f5c8406ae2bd080ee Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Jan 2026 11:09:27 +0800 Subject: [PATCH 2/2] Bump version to 0.3.13 --- optillm/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/optillm/__init__.py b/optillm/__init__.py index 506a00d..76134bd 100644 --- a/optillm/__init__.py +++ b/optillm/__init__.py @@ -1,5 +1,5 @@ # Version information -__version__ = "0.3.12" +__version__ = "0.3.13" # Import from server module from .server import ( diff --git a/pyproject.toml b/pyproject.toml index 813e2ff..b697021 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "optillm" -version = "0.3.12" +version = "0.3.13" description = "An optimizing inference proxy for LLMs." readme = "README.md" license = "Apache-2.0"