Skip to main content

embed-client

Python async client for the Embedding Service API. The canonical public client is EmbeddingClient, aligned with the migrated server-side contract (JSON-RPC via mcp-proxy-adapter).

from embed_client import EmbeddingClient

Installation

pip install embed-client

Editable development checkout:

git clone <repository-url>
cd embed-client
pip install -e .

Canonical real-server E2E (localhost:8001, mTLS)

The repository ships a runnable end-to-end tour of the public API against localhost:8001 with mTLS, using certificates under mtls_certificates/ (see mtls_certificates/README.md if present).

Artifact Path
Example script examples/canonical_mtls_localhost_8001.py
Live integration Set RUN_CANONICAL_MTLS_E2E=1 to perform real network calls (otherwise dry run / config check)
Optional embed_file Set CANONICAL_EMBED_FILE_SERVER_PATH to a server-visible file path to include embed_file in the tour
Tests tests/test_canonical_mtls_example.py
python examples/canonical_mtls_localhost_8001.py
RUN_CANONICAL_MTLS_E2E=1 python examples/canonical_mtls_localhost_8001.py

Minimal usage

import asyncio
from embed_client import EmbeddingClient

async def main() -> None:
    async with EmbeddingClient.from_base_url_port("http://localhost", 8001) as client:
        h = await client.health()
        print("health:", h)
        data = await client.embed(["hello"], error_policy="continue", wait=True)
        print("embed keys:", list(data.keys()) if isinstance(data, dict) else type(data))

if __name__ == "__main__":
    asyncio.run(main())

Public queue-oriented helpers include embed, wait_for_job, job_status, list_queued_commands, cmd, optional embed_file, plus introspection (list_commands, models, fetch_openapi_schema, http_get, timing_stats) and TLS helpers is_mtls_enabled, get_ssl_config. See embed_client/embedding_client.py for the full list.

embed_file vs local JSON without shared server disk: use embed_file with a server-visible input_file when the input already exists on the service host. For a json_array file that exists only on the client machine (no shared filesystem), use the CLI embed-file-json subcommand (or embed_file_from_local_json_file) so the client validates, uploads through the adapter, resolves storage_path via get_upload_session, then runs embed_file with that path and format=json_array. For Markdown sources (e.g. with YAML front matter), run prepare-embed-file-json first to emit a valid json_array (array of strings): the body is split only on blank lines (\n\n) into paragraph-sized strings, with per-paragraph UTF-8 size limits and no automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then embed-file-json. Add --show-progress to stream server WebSocket/status lines to stderr during the job wait (see CLI_README.md).

Documentation

Security modes

The server supports multiple HTTP/HTTPS/mTLS and auth combinations. For deploy-time verification expectations, see the project deploy rule; for field-level mapping, see CONFIGURATION.md and docs/SERVER_MODES_AND_CLIENT.md.

Development and tests

Run the test suite with pytest; configuration lives in pyproject.toml ([tool.pytest.ini_options]). There is no pytest.ini at the repository root.

pytest -q

License

MIT License

Author

Vasiliy Zdanovskiyvasilyvz@gmail.com

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

embed_client-4.0.16.tar.gz (359.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

embed_client-4.0.16-py3-none-any.whl (98.9 kB view details)

Uploaded Python 3

File details

Details for the file embed_client-4.0.16.tar.gz.

File metadata

  • Download URL: embed_client-4.0.16.tar.gz
  • Upload date:
  • Size: 359.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for embed_client-4.0.16.tar.gz
Algorithm Hash digest
SHA256 76c4a00ce2edd7ed0a06d163d64db53ab40f045e61f5f2e01237176d88035d08
MD5 23891062853f4d22a9a6cb355c8d29c9
BLAKE2b-256 0034eaed4c4d408161507e5093920e4b062e005f5c0e586e85471faf1e148344

See more details on using hashes here.

File details

Details for the file embed_client-4.0.16-py3-none-any.whl.

File metadata

  • Download URL: embed_client-4.0.16-py3-none-any.whl
  • Upload date:
  • Size: 98.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for embed_client-4.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 8cda6b32ccc22e299941c402b2170efe6d862718427eb50ffdf0dac234070a3c
MD5 10c3fc46e196dbe0e3f2504ab64c361f
BLAKE2b-256 3b1e8f2b5bd93a75d01ce0cd1afc30690a00c309448704b5d55cdc8de48f16f5

See more details on using hashes here.

Release history Release notifications | RSS feed

4.0.20

2 files

4.0.19

2 files

4.0.18

2 files

4.0.17

2 files

This release

4.0.16 This release

2 files

4.0.15

2 files

4.0.14

2 files

4.0.13

2 files

4.0.12

2 files

4.0.11

2 files

4.0.1

2 files

4.0.0

2 files

3.1.9.6

2 files

3.1.9.5

2 files

3.1.9.4

2 files

3.1.9.3

2 files

3.1.9.2

2 files

3.1.9.1

2 files

3.1.9.0

2 files

3.1.8.0

2 files

3.1.7.28

2 files

3.1.7.27

2 files

3.1.7.26

2 files

3.1.7.25

2 files

3.1.7.24

2 files

3.1.7.23

2 files

3.1.7.22

2 files

3.1.7.21

2 files

3.1.7.20

2 files

3.1.7.19

2 files

3.1.7.18

2 files

3.1.7.17

2 files

3.1.7.16

2 files

3.1.7.15

2 files

3.1.7.14

2 files

3.1.7.13

2 files

3.1.7.12

2 files

3.1.7.11

2 files

3.1.7.10

2 files

3.1.7.9

2 files

3.1.7.8

2 files

3.1.7.7

2 files

3.1.7.6

2 files

3.1.7.5

2 files

3.1.7.4

2 files

3.1.7.3

2 files

3.1.7.2

2 files

3.1.7.1

2 files

3.1.7.0

2 files

3.1.6.0

2 files

3.1.5.0

2 files

3.1.3.0

2 files

3.1.2.0

2 files

3.1.1.2

2 files

3.1.1.1

2 files

3.1.1.0

2 files

3.1.0.9

2 files

3.1.0.8

2 files

3.1.0.7

2 files

3.1.0.6

2 files

3.1.0.5

2 files

3.1.0.4

2 files

3.1.0.3

2 files

3.1.0.2

2 files

3.1.0.1

2 files

3.1.0.0

2 files

2.0.0.0

2 files

1.0.14.0

2 files

1.0.1.1

2 files

1.0.0.1

2 files

1.0.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page