weaviate-client-web
Runs the async Weaviate Python client
under Pyodide (browser pages, marimo notebooks, Web Workers): gRPC goes over grpc-web and
REST over fetch.
Requires Weaviate ≥ 1.38.3 (the first release serving grpc-web) or a grpc-web transcoder in front of an older server. Tested on Pyodide 314.0.4 (CPython 3.14).
Installation
Install through the base client's grpc-web extra:
import micropip
await micropip.install("weaviate-client[grpc-web]")
The extra has a sys_platform == "emscripten" marker, so it installs nothing on CPython.
micropip.install("weaviate-client-web") also works; it pins weaviate-client to its own
version. Both need a weaviate-client release that ships the extra; older releases fail to
resolve grpcio.
The package imports pyodide at module scope, so it imports only under Pyodide.
How it works
Under Pyodide there is no grpcio wheel. Importing this package puts a pure-Python grpc
shim in sys.modules, and GrpcWebChannel sends unary RPCs as grpc-web POSTs through
pyodide.http.pyfetch. Call metadata (API key, OIDC bearer) becomes fetch headers.
Under Pyodide the connect helpers send gRPC to the REST endpoint (same host, port and TLS)
under /v1/grpc-web. As in the TypeScript @weaviate/web client, native gRPC is not
available there, so this endpoint is not configurable through the helpers.
To use a grpc-web transcoder on another endpoint (Envoy, vanguard), for example in front of Weaviate < 1.38.3, build the connection parameters yourself:
from weaviate import WeaviateAsyncClient
from weaviate.connect import ConnectionParams
client = WeaviateAsyncClient(
ConnectionParams.from_params(
http_host="weaviate.example.com", http_port=443, http_secure=True,
grpc_host="transcoder.example.com", grpc_port=443, grpc_secure=True,
# add grpc_path_prefix="/prefix" if the transcoder is not at the root
)
)
REST goes through the package's own fetch-based httpx transport, including on Pyodide
builds whose httpx has one (that one fails on body-less HEAD/204 responses).
Usage
With this package installed, import weaviate imports it first, under Pyodide only. If it
is missing, import weaviate raises an ImportError naming the extra. Against
Weaviate ≥ 1.38.3:
import weaviate
client = weaviate.use_async_with_local(port=8080)
await client.connect() # runs the gRPC health check over grpc-web
collection = client.collections.get("Article")
await collection.query.near_text("hello", limit=3)
client = weaviate.use_async_with_weaviate_cloud(
cluster_url="rAnD0mD1g1t5.something.weaviate.cloud",
auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"),
)
Weaviate Cloud: browser use requires Allow all CORS origins in the cluster's settings
in the Weaviate Cloud console (takes a few minutes to apply). Until it applies, the client
fails at its first REST call with a Failed to fetch connection error.
use_async_with_custom() still requires grpc_host/grpc_port/grpc_secure — Python
cannot drop required parameters on one platform the way TypeScript drops them from a
type. Pass the HTTP values; anything else is overridden with them and warned about
(Con006), so a browser client never silently points somewhere it cannot reach.
client = weaviate.use_async_with_custom(
http_host="localhost", http_port=8080, http_secure=False,
grpc_host="localhost", grpc_port=8080, grpc_secure=False, # = the HTTP endpoint
)
Pass headers={...} / auth_credentials=... as usual for API keys, OIDC or Weaviate Cloud.
Importing weaviate_client_web before weaviate is equivalent.
Supported / unsupported
| Feature | Kind | Status |
|---|---|---|
| Search, Aggregate, TenantsGet, BatchObjects, BatchDelete | unary gRPC | Yes, over grpc-web |
Health check (/grpc.health.v1.Health/Check) |
unary gRPC | Yes, on connect() over grpc-web |
REST (is_ready, config, /batch/references, …) |
REST | Yes, via the package's own fetch transport |
API-key auth (Auth.api_key) |
header | Yes |
OIDC auth (client_credentials / client_password / bearer_token) |
REST | Untested: token refresh runs on an asyncio task (no threads) |
Bulk insert: collection.data.insert_many() |
unary gRPC | Yes, the bulk path under Pyodide |
batch.stream() / batch.experimental() (BatchStream) |
bidi streaming | No: grpc-web has no bidirectional streaming; raises at once, use insert_many() |
batch.dynamic() / fixed_size() / rate_limit() |
sync-client API | No: sync client only |
Embedded Weaviate (use_async_with_embedded) |
subprocess | No: raises "not supported under WebAssembly/Pyodide" |
| Synchronous client | — | No: async only |
Configuration not honored in the browser
fetch manages connections itself, so several knobs are accepted but have no effect
under Pyodide:
AdditionalConfig.proxies/trust_envproxy environment variables (the browser cannot proxy fetch requests per-client),- connection-pool sizing and
session_pool_max_retries, GrpcConfig.credentials(custom CA bundles — the browser's trust store decides TLS),GrpcConfig.channel_options, includinggrpc.max_send_message_length/grpc.max_receive_message_length(onlygrpc-web.path_prefixis consumed). The practical message-size ceiling is the server'sgrpcMaxMessageSize(reported by/v1/meta); exceeding it surfaces asRESOURCE_EXHAUSTED,Proxies.grpc/GRPC_PROXY.
CORS requirements (browsers)
Self-hosted Weaviate ≥ 1.38.3 (unchanged through 1.40.0-rc.1) answers CORS for its
/v1/grpc-web endpoint as follows (for Weaviate Cloud, see Usage):
- allowed origins come from
CORS_ALLOW_ORIGIN(default*); - allowed request headers are
X-Grpc-Web,X-User-Agent,Grpc-Timeout,Connect-Protocol-Version,Connect-Timeout-MsandX-Weaviate-Client, plus everything inCORS_ALLOW_HEADERS, whose default already coversContent-Type,Authorization,X-Weaviate-Cluster-Urland the vendor*-Api-Keyheaders; - exposed response headers are
Grpc-Status,Grpc-MessageandGrpc-Status-Details-Bin.
A custom headers={...} entry outside that list must be added to CORS_ALLOW_HEADERS,
or the browser's preflight rejects the request. A proxy or grpc-web transcoder in front of
Weaviate must allow the same origins and request headers and expose the same response
headers; without grpc-status, grpc-message exposed, trailers-only error responses (e.g.
a bad API key) are reported as INTERNAL: grpc-web response contained no message frame
instead of the real error.
In the browser a CORS-blocked request is indistinguishable from a network failure
(TypeError: Failed to fetch), and is retried as UNAVAILABLE.
Testing
Because the package imports pyodide at module scope, its unit tests run inside
Pyodide. From the repository root:
python -m build --wheel --outdir dist .
python -m build --wheel --outdir dist packages/web
npm install --prefix ci/pyodide-e2e
node --experimental-wasm-jspi ci/pyodide-e2e/units.mjs dist # pytest unit suite, no Weaviate needed
node ci/pyodide-e2e/run.mjs dist # e2e suite, needs a running Weaviate (see ci/)
Metadata
Release files for weaviate-client-web 4.25.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| weaviate_client_web-4.25.1-py3-none-any.whl | Python 3 | none | any | Details for weaviate_client_web-4.25.1-py3-none-any.whl |
Release files / weaviate_client_web-4.25.1-py3-none-any.whl
| Download URL | weaviate_client_web-4.25.1-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1835a517cab9b45f46499c6c2f333a20e9ae79291b16153f9c7552c630eb226
|
|
BLAKE2b-256 checksum How to use checksums |
b1846cf7678168261835cee472652f28c5695285c5bcee60c9c395fc30f7c6ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for weaviate-client-web 4.25.1
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.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for weaviate_client_web-4.25.1-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA 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.