Vermeer Python Client
vermeer-python-client is the Python SDK for Vermeer, the memory-first graph computing engine written in Go. The SDK wraps the REST API of the Vermeer master so you can list graphs, submit load and compute tasks, and read task state from Python. The import package is pyvermeer.
The module does not pin a Vermeer server version. It talks to the Vermeer master over HTTP using the endpoints listed in API Surface.
Requirements
- Current source requires Python 3.10 or later because its type annotations use Python 3.10 features, although packaging metadata still declares
>=3.9. - A running Vermeer master reachable over HTTP on its default port
6688. Docker deployments must publish6688:6688; see the Vermeer quick start. uv(recommended) orpip
Runtime dependencies: requests, urllib3, python-dateutil, decorator, rich, and setuptools.
Installation
The distribution name in the packaging metadata is vermeer-python-client and the version is managed independently of the repository version. The package is not published on PyPI yet, so install it from source.
From the root of the HugeGraph-AI repository, the vermeer extra installs it into the shared virtual environment:
vermeer-python-client is wired in as an editable path dependency rather than a uv workspace member, so a plain uv sync at the repository root does not install it. You have to ask for the extra (or for --all-extras).
To install the module standalone:
Connect to a Vermeer Master
Constructor parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
ip | str | required | Host name or IP address of the Vermeer master |
port | int | required | REST port of the Vermeer master |
token | str | required | Sent verbatim as the Authorization request header |
timeout | (float, float) or None | None | Connect and read timeouts in seconds |
log_level | str | "INFO" | Level applied to the shared VermeerClient logger |
For a client running on the host, use a master address reachable from that host. For a container client, use its container-network address. The client connects only to the master HTTP API; PD and Store addresses must be reachable from the Vermeer nodes that perform loading.
Behavior worth knowing before you connect:
tokenmay be an empty string when the master does not check authorization, but it cannot beNone. The session raisesValueError("Vermeer Token must be provided.")in that case.timeoutis a(connect, read)pair.VermeerConfighas its own default of(0.5, 15.0), but the client always forwards its own argument, so omittingtimeoutstoresNoneand the request waits without a deadline. Pass the pair explicitly if you want one.- The base URL is always built as
http://{ip}:{port}/, so the client speaks plain HTTP. - Every request sets
Content-Type: application/jsonand serializesparamsinto the request body, including forGETrequests. - The session configures up to 3 retries on HTTP 500, 502, and 504 with backoff factor
0.1. Status retries follow urllib3’s default allowed methods, which excludePOST; do not rely on automatic retries for task submission. log_levelsets the level of the shared logger namedVermeerClient. Its console handler is fixed atINFO, soDEBUGrecords are not printed to the console today.
End-to-End Example
The module ships vermeer-python-client/src/pyvermeer/demo/task_demo.py. This extended example polls with a deadline, waits for loading, reads the graph, and submits PageRank. It reads PD peers and the HugeGraph password from environment variables. The worker group must match the task-space allocation; a single-worker quick start can use worker_group=$. Bind a named group to the task space first, as shown in the Vermeer quick start.
Loading succeeds with loaded; computation succeeds with complete. error or canceled stops the example. Set VERMEER_PD_PEERS to a JSON array string, for example export VERMEER_PD_PEERS='["hugegraph-pd:8686"]'. The master must reach these PD addresses, and workers must reach the Store addresses returned by PD. Set VERMEER_TOKEN only if the master uses token authentication; an empty string works without it.
output.type=local writes results to the executing worker’s local filesystem with file-name prefix result/pagerank. Mount its result directory to read container output from the host. poll_timeout is the client polling deadline; requests between checks remain subject to HTTP timeouts and SDK retries, so completion can exceed that deadline. A timeout stops client waiting, not the Server task.
Never hardcode a real HugeGraph password into a script or configuration file. Use an environment variable or credential store.
Save and Run the Documentation Example
Save the complete extended example above as vermeer_client_example.py at the hugegraph-ai/ repository root. Run it with the workspace’s vermeer extra:
Enter the password and press Enter. Replace hugegraph-pd:8686 with a PD address reachable from the Vermeer master. If token authentication is enabled, supply VERMEER_TOKEN through your local credential-management method. These commands run the extended documentation example, not the bundled demo.
Original Bundled Demo
vermeer-python-client/src/pyvermeer/demo/task_demo.py is a separate minimal example. It hardcodes client port 8688, PD address 127.0.0.1:8686, and placeholder credentials xxx. It does not read the extended example’s environment variables, poll task state, or compute PageRank. Adjust its addresses and credentials separately if running it; it does not replace the documentation commands above.
API Surface
PyVermeerClient exposes its API groups as attributes. Two groups are registered today, graph and tasks.
client.graph
| Method | Vermeer endpoint | Returns |
|---|---|---|
get_graphs() | GET /graphs | GraphsResponse |
get_graph(graph_name) | GET /graphs/{graph_name} | GraphResponse |
client.tasks
| Method | Vermeer endpoint | Returns |
|---|---|---|
get_tasks() | GET /tasks | TasksResponse |
get_task(task_id) | GET /task/{task_id} | TaskResponse |
create_task(create_task) | POST /tasks/create | TaskCreateResponse |
pyvermeer/api/master.py and pyvermeer/api/worker.py contain only the license header, and neither group is registered on the client. Master and worker information is therefore not reachable from the client yet, even though MasterResponse and WorkersResponse already exist under pyvermeer/structure/.
client.send_request(method, endpoint, params) is the shared entry point behind both groups. You can call it directly to reach a Vermeer endpoint that has no wrapper yet; it returns the decoded JSON body as a plain dict.
Requests and Responses
TaskCreateRequest(task_type, graph_name, params) is serialized as {"task_type": ..., "graph": ..., "params": ...}. Note that graph_name becomes graph on the wire, which matches the payload documented for the Vermeer REST API.
Every response type extends BaseResponse and exposes errcode and message, plus a to_dict() helper. errcode is 0 on success and 1 on error; -1 means the field was missing from the response body.
GraphsResponse.graphsandGraphResponse.graphyieldVermeerGraphobjects withname,space_name,status,create_time,update_time,vertex_count,edge_count,workers,worker_group,use_out_edges,use_property,use_out_degree,use_undirected,on_disk, andbackend_option.TasksResponse.tasks,TaskResponse.task, andTaskCreateResponse.taskyieldTaskInfoobjects withid,state,create_user,create_type,create_time,start_time,update_time,graph_name,space_name,params,workers, anderror_message.- Timestamps are parsed with
python-dateutilintodatetimeobjects. An empty timestamp string becomesNone.
Server returns the task type as task_type, but SDK TaskInfo.type reads type, so that property is currently empty. The SDK also drops Server statistics_result. Use TaskInfo.state for polling. This is a field-contract mismatch in current source.
Task Parameters
The client does not validate params. Keys and values are passed straight through to Vermeer, so the accepted names come from the engine, not from the SDK. For the load parameters and the parameters of the supported algorithms, see the Vermeer quick start.
The usual sequence is the same as with the REST API directly: create a load task to read the graph into Vermeer, wait for it to finish, then create computation tasks against the loaded graph.
Errors
pyvermeer.utils.exception defines four exceptions, all raised from the underlying requests or JSON failure:
| Exception | Raised when |
|---|---|
ConnectError | requests.ConnectionError, the master is unreachable |
TimeOutError | requests.Timeout, the connect or read deadline expired |
JsonDecodeError | The response body is not valid JSON |
UnknownError | Any other failure during the request |
The client does not check the HTTP status code of the response, so inspect errcode and message on the returned object to tell success from a Vermeer-side error.
Development Checks
Run the formatting and static checks from the root of the HugeGraph-AI repository:
The source lives under vermeer-python-client/src/pyvermeer/. A few structure tests are available under src/tests/structure/test_task_data.py; they do not cover HTTP API integration.
References
- vermeer-python-client on GitHub
- Vermeer graph computing engine
- Vermeer quick start
- HugeGraph-AI quick start