flopscope-client
Lightweight drop-in replacement for flopscope that proxies all operations to a remote flopscope-server over ZMQ + msgpack.
flopscope-client provides the same import flopscope Python module as the main flopscope distribution, but with no NumPy dependency — it forwards every counted operation to a flopscope-server process. Use this in constrained environments where you want flopscope's FLOP-counting API but cannot ship numpy + the full library (e.g. sandboxed participant containers in the ARC Whitebox Estimation Challenge).
Install instead of, not alongside
flopscope-client occupies the same flopscope Python import namespace as the main package. The two are mutually exclusive — installing both leads to file-overlap in flopscope/. Choose one:
# Lightweight: client-only, no numpy
pip install flopscope-client
# Heavy: full library on the local machine
pip install flopscope
# Server-side: both flopscope + flopscope-server, pinned together
pip install "flopscope[server]"
Quick start
The client connects to a flopscope-server instance specified by the FLOPSCOPE_SERVER_URL environment variable:
export FLOPSCOPE_SERVER_URL=tcp://flopscope-server.example.com:15555
# or for a local UNIX socket:
export FLOPSCOPE_SERVER_URL=ipc:///tmp/flopscope.sock
Then use flopscope normally — the import path and API are identical to the main distribution:
import flopscope as flops
import flopscope.numpy as fnp
with flops.BudgetContext(flop_budget=1_000_000):
a = fnp.array([1.0, 2.0, 3.0])
b = fnp.array([4.0, 5.0, 6.0])
result = fnp.add(a, b) # round-trips to the server, runs there
flops.budget_summary()
On the first request, the client performs a version handshake with the server. A version mismatch raises ConnectionError with both versions in the error message — keep flopscope-server and flopscope-client on the same release.
Differences from NumPy
The API mirrors NumPy, with one semantic difference worth knowing up front: flopscope arrays are immutable (like JAX). Item assignment and indexed in-place updates raise TypeError:
arr[i] = value # TypeError: flopscope arrays are immutable
arr[i] += value # same error — desugars to arr[i] = arr[i] + value
Build results functionally instead — collect the pieces in a list and fnp.stack(...) them, or use a whole-array update (arr = arr + x, which rebinds rather than mutates). See the Immutable arrays guide for the accumulation recipe.
When to choose this over the main flopscope install
| Scenario | Install |
|---|---|
| You want flopscope's API in a process that has full NumPy + scientific stack | pip install flopscope |
| You're shipping a sandboxed container that must not contain numpy / scipy | pip install flopscope-client |
| You're running the server side that hosts computation for many clients | pip install flopscope-server (brings flopscope along) |
| You're deploying both sides on one machine, version-pinned | pip install "flopscope[server]" |
Architecture overview
┌─────────────────────────────┐ ZMQ + msgpack ┌──────────────────────────────┐
│ flopscope-client process │ ───────────────────────────▶ │ flopscope-server process │
│ (sandbox; no numpy) │ │ (full flopscope + numpy) │
│ `import flopscope as flops`│ ◀─────────────────────────── │ Executes ops, tracks budget │
└─────────────────────────────┘ └──────────────────────────────┘
The client serializes each operation (op name, args, kwargs) as msgpack, sends it over the ZMQ REQ/REP socket, and decodes the response. Budget tracking, symmetry-aware FLOP counting, and operation-cost analytics all happen on the server side; the client just relays calls.
Related
flopscope— full NumPy-backed library (alternative install)flopscope-server— the server-side runtime this client connects to- Documentation — full guides
- GitHub — source, CHANGELOG, contributor guide
License
Metadata
Release files for flopscope-client 0.10.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 | |
|---|---|---|---|
| flopscope_client-0.10.0.tar.gz | 156.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flopscope_client-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 232.2 kB
Release files / flopscope_client-0.10.0.tar.gz
| Download URL | flopscope_client-0.10.0.tar.gz |
|---|---|
| Size | 156.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dc6288301efdb0005a750b85c597c9d31b706c3c2f829a283ade77b8930f680
|
|
BLAKE2b-256 checksum How to use checksums |
968526ee78d62f7f9afc8ecdf64d19e3beb74989d96c52f39c9d109659453687
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Jul 30, 2026.
Transparency logRelease files / flopscope_client-0.10.0-py3-none-any.whl
| Download URL | flopscope_client-0.10.0-py3-none-any.whl |
|---|---|
| Size | 75.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6384fe3db2c1487a6e3cff295c496cac238f1ee8a854717a91ec43ca54b9aca
|
|
BLAKE2b-256 checksum How to use checksums |
0d21c7e4c2d30adf90f8e098cf4be9a26b1d0679661f47b58a90f4ff1a434273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Jul 30, 2026.
Transparency log