From 6b88e7bd59ceabc31ea30f32dd5e4e50f07b6e2f Mon Sep 17 00:00:00 2001 From: kigland Date: Sun, 1 Mar 2026 16:42:51 +0800 Subject: [PATCH] fix: remove LocalBackend from art.__all__ and fix docs reference LocalBackend is listed in __all__ but never imported at the top level, causing AttributeError on `from art import LocalBackend`. It cannot be imported eagerly because it depends on torch, transformers, and other heavy optional packages from the [backend] extra. Users should continue to use `from art.local import LocalBackend`. Also fix the LangGraph integration doc that used the broken `art.LocalBackend()` pattern. --- docs/integrations/langgraph-integration.mdx | 3 ++- src/art/__init__.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/integrations/langgraph-integration.mdx b/docs/integrations/langgraph-integration.mdx index a9f49d74..5d28c6c8 100644 --- a/docs/integrations/langgraph-integration.mdx +++ b/docs/integrations/langgraph-integration.mdx @@ -260,11 +260,12 @@ from pydantic import BaseModel, Field from tenacity import retry, stop_after_attempt from art.langgraph import init_chat_model, wrap_rollout +from art.local import LocalBackend from art.utils import iterate_dataset # Initialize model and backend model = art.Model(name="Qwen/Qwen2.5-7B-Instruct") -backend = art.LocalBackend() +backend = LocalBackend() # Data models class EmailResult(BaseModel): diff --git a/src/art/__init__.py b/src/art/__init__.py index bc82c4dc..020652a8 100644 --- a/src/art/__init__.py +++ b/src/art/__init__.py @@ -82,7 +82,6 @@ def __init__(self, **kwargs): "gather_trajectory_groups", "trajectory_group_batches", "Backend", - "LocalBackend", "LocalTrainResult", "ServerlessBackend", "ServerlessTrainResult",