Make the SDK legible: usage docs, shipped types, and discovery ergonomics
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- api, developer-experience, documentation
Research direction
Start by choosing one scoped gap from the README, packaging and py.typed work, discovery.py, selection, live_runner, or registration. Read the relevant entry point and existing pytest coverage first; done means the selected SDK behavior or documentation is implemented without relying on private attributes, with tests or examples updated to demonstrate it.
Written by the indexing model from the issue text.
Description
Built seven examples against ja/live-runner in runner-app-examples and repeatedly had to read go-livepeer's Go structs, or the SDK source, to answer questions the SDK could have answered itself. Collecting the gaps.
Docs and discoverability
READMEhas no.mdextension, so GitHub renders it as plain text. Its 142 lines are maintainer instructions (protobuf generation, pytest, coverage) — there is no usage documentation. Someone landing here learns how to rebuild the protos, not how to reserve a session. Suggest: rename toREADME.md, lead with a quickstart for both shapes (runner_selector→call_runner, andreserve_session→ call →stop_runner_session), move maintainer material toCONTRIBUTING.md.- No
py.typed. The package is thoroughly annotated, but without the marker every consumer's type checker treats it as untyped. One empty file plus a packaging entry turns all existing annotations into working documentation. - Module-level docstrings. The first question is "which module do I import from" —
selectionvslive_runnervsdiscoveryis not self-evident, and per-function prose does not answer it. examples/mixes two eras.write_control.py,subscribe_events.py,start_job.py, andin_out_composite.pyarelv2v;echo/,ping-pong/, andtext/are live runner. Pattern-matching from that directory can producestart_lv2v(StartJobRequest(...))in the belief it is the live-runner API. Worth labelling or separating.- Linking runner-app-examples from the README would help — it is already the de-facto usage documentation, verified end to end.
Discovery ergonomics
LiveRunnerInstancetypes a minority of what discovery publishes.url,app,mode, andprice_infoare typed;gpu,metadata,version,capacity,capacity_used, andcapacity_availableare reachable only throughraw, despite go-livepeer publishing all of them (ai/runner/live_runner.go:189-199). Suggest typing every field the discovery schema defines, keepingrawfor anything newer than the installed SDK. Ametadata_json()helper would also stop every caller reimplementing the same parse — but the field should staystr, since the protocol guarantees an opaque string.- Filtering the candidate list costs you the failover.
cursor.candidatesis a tuple copy, so narrowing it means abandoningcursor.next()and hand-rolling the retry loop, losingcursor.rejectionswith it. Something likecursor.filter(pred)/cursor.order_by(key)that narrows in place would keep one code path. Discovery filters are exact set membership (discovery.py:303), so any selection on capacity, GPU, or metadata is client-side today. - Candidates are unordered. They arrive in discovery order, so
candidates[0]— which every example uses — is arbitrary rather than cheapest or least loaded. Worth deciding whether a default ordering belongs in the SDK, since it affects how work spreads across orchestrators.
Runtime state
- No public setter for
statusorcapacity, and no way to force an immediate heartbeat. Both exist privately (registration._status,registration._send_heartbeat()). They are needed for the one workaround available to an app whose registrations share a GPU (see go-livepeer#4015): flip every registration out ofreadytogether when the hardware is saturated, and beat immediately rather than waiting out the interval. An example should not have to reach into private attributes to do that.
Happy to take any of these as PRs.
- Dominant language
- Python
- Stars
- 1
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from livepeer/livepeer-python-gateway
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
livepeer/livepeer-python-gateway#64 · 1 comment ·
-
Improvement
Difficulty 1/5 Under an hour Newbie friendliness 68/100
livepeer/livepeer-python-gateway#27 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
livepeer/livepeer-python-gateway#12 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 76/100
livepeer/livepeer-python-gateway#62 · 3 comments ·
All issues in livepeer/livepeer-python-gateway
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100