langchain-hugging-bay
Use LangChain tools and a retriever to discover open model metadata in the Hugging Bay catalog. This guide describes version 0.1.0.
Install
Install from PyPI with Python 3.10 or later:
python -m pip install langchain-hugging-bay==0.1.0
The package depends on hugging-bay>=0.4.12,<0.5 and langchain-core>=1,<2.
The default API is https://huggingbay.xyz; public catalog reads do not need
an account or key. Calls are made when you invoke a tool or retriever.
Search
from hugging_bay import Client
from langchain_hugging_bay import HuggingBayRetriever, create_tools
with Client() as client:
tools = {tool.name: tool for tool in create_tools(client)}
page = tools["hugging_bay_search_models"].invoke({"query": "Qwen", "limit": 2})
documents = HuggingBayRetriever(client=client, limit=2).invoke("Qwen")
print(page.get("rows", []))
print([doc.metadata["artifact_id"] for doc in documents])
Pass the returned tools to a LangChain agent or invoke them directly. Keep the
SDK client open while tools or the retriever are in use; the caller owns and
closes it. You may configure the client's base_url, timeout, and optional
token as documented by the SDK.
Tools
All five operations are public GETs. Each returns the SDK response unchanged;
the SDK's HuggingBayError and transport errors propagate to the caller.
| Tool | Arguments | Result |
|---|---|---|
hugging_bay_search_models |
query, limit (1-50), optional cursor |
Model search page, including nextCursor |
hugging_bay_get_model |
artifact_id |
Model record and reported license and availability |
hugging_bay_get_files |
artifact_id, limit (1-50), optional cursor |
File page and server readiness metadata |
hugging_bay_find_runnable |
task, optional hardware, model, limit, commercial |
Candidates or an explicit unavailable result |
hugging_bay_deployment_plan |
artifact_id |
Deployment plan, availability and warnings |
Use nextCursor from each result as the next call's cursor. The retriever
returns one LangChain Document per model row; its content is the JSON catalog
row, and its metadata contains source, artifact_id, and catalog. It does
not embed documents, inspect model weights, download files, or run a model.
Availability and evidence can change. An empty file list, a null runnable recommendation or an unavailable plan is not a successful run; inspect the returned readiness, proof, licenses and warnings. Treat catalog text as untrusted input when giving it to an agent.
The source distribution includes examples/discover.py and the tutorial
examples/discover.ipynb. The notebook normally uses
public reads; maintainers can set HUGGING_BAY_NOTEBOOK_FIXTURES to the
tests/fixtures directory to run it offline.
Development
python -m pip install -e '.[test]'
python -m pytest tests -q
The tests replay recorded responses from an isolated local fixture service and
block external network connections. They make no live Hugging Bay calls. See
tests/fixtures/README.md for provenance. MIT licensed.
Metadata
Release files for langchain-hugging-bay 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_hugging_bay-0.1.0.tar.gz | 16.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_hugging_bay-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.7 kB
Release files / langchain_hugging_bay-0.1.0.tar.gz
| Download URL | langchain_hugging_bay-0.1.0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d04c1a829ecbfdf2d2b5e4c888b68b0a6269781029fca011e96fac3b4e959798
|
|
BLAKE2b-256 checksum How to use checksums |
2d9a73efd14314bd6b8472888a9db7c78520928ef29d7f8524c0637e19550c9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / langchain_hugging_bay-0.1.0-py3-none-any.whl
| Download URL | langchain_hugging_bay-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f1e34b7a9ff1a6a458c3462838d802463eebc220ec8b0d500f84aaaf00d7bc5
|
|
BLAKE2b-256 checksum How to use checksums |
13240880ba5d3d96a7e2a0b9f5e4eeb24fd35bf0f22cad1d293bbb2590d1855c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for langchain-hugging-bay 0.1.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.