A dynamic, metadata-driven query router for Snowflake and Snowpark
pip install snowflake-switchboard-ai Copy PIP instructions
snowflake-switchboard-ai is a metadata-driven, zero-cost query router for Snowflake and Snowpark.
It automatically inspects your query execution plan before execution to estimate projected data volumes (bytesAssigned), dynamically routing your queries to the optimal warehouse tier to maximize performance while minimizing compute costs.
Install the package directly from PyPI into your environment or notebook:
from switchboard import MultiTierSwitchboard # 1. Initialize with automatic default thresholds sb = MultiTierSwitchboard( session=session, warehouses=["xsmall_wh", "small_wh", "medium_wh", "large_wh", "xlarge_wh", "xxlarge_wh"] ) # 2. Run queries effortlessly using callable shorthand sb(""" SELECT c_mktsegment, COUNT(*) FROM SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.CUSTOMER GROUP BY c_mktsegment """) 📊 Default Threshold Mapping When custom thresholds are not specified, MultiTierSwitchboard routes queries using these exact default payload limits:
If you want granular control over when queries switch warehouse tiers, pass your own custom byte limits via thresholds:
# Pass custom byte limits matching your warehouse boundaries: sb = MultiTierSwitchboard( session=session, warehouses=["xsmall_wh", "small_wh", "medium_wh"], thresholds=[1_000_000_000, 10_000_000_000] ) 📸 Live Execution Output Here is how snowflake-switchboard-ai looks in action inside a Snowflake Notebook:
Distributed under the MIT License. See LICENSE for more information.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




