Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

fix: suppress '[transformers] PyTorch was not found' startup warning (#1066)

r00t5208e32d64dc
diff --git a/headroom/memory/adapters/embedders.py b/headroom/memory/adapters/embedders.py
index dba028b11..fce7bea3f 100644
--- a/headroom/memory/adapters/embedders.py
+++ b/headroom/memory/adapters/embedders.py
@@ -31,6 +31,7 @@ if TYPE_CHECKING:
# We operate in an authenticated-optional mode; warnings are not actionable.
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
os.environ.setdefault("HF_HUB_DISABLE_IMPLICIT_TOKEN", "1")
+os.environ.setdefault("TRANSFORMERS_VERBOSITY", "error")
warnings.filterwarnings("ignore", category=UserWarning, module="huggingface_hub")
# Also silence the huggingface_hub logger which emits rate-limit advisory messages.
logging.getLogger("huggingface_hub").setLevel(logging.ERROR)
diff --git a/headroom/proxy/server.py b/headroom/proxy/server.py
index f64a4c87d..07b343c38 100644
--- a/headroom/proxy/server.py
+++ b/headroom/proxy/server.py
@@ -424,6 +424,11 @@ def _build_agent_usage_summary(
}
+# Suppress "[transformers] PyTorch was not found" warning emitted when
+# transformers is imported for availability checks (e.g. kompress ONNX probe).
+# PyTorch is optional in headroom; the warning is not actionable for operators.
+os.environ.setdefault("TRANSFORMERS_VERBOSITY", "error")
+
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)