Skip to content

Protocol drift: remote.py covers ~11 of ~30 routes; api.ts shapes lag the server #9

Description

@thedataengineer

Drift between the server routes (serve.py), the SDK client (remote.py), and the frontend typed mirror (frontend/src/api.ts). No dead or missing routes; the gaps are coverage and shapes.

remote.py (SDK client):

  • Covers roughly 11 of ~30 served routes. Missing: all of datasets (list/get/create/delete/hf-info/preview), models (list/downloads/download/custom), settings, vram, methods, tokens, prewarm, checkpoints, auth/login. The docstring endpoint list at remote.py:8-21 reflects the same subset.
  • submit_finetune (remote.py:135-147) never sends name, so SDK-submitted jobs render with blank names in the UI (serve.py:833 reads it). It also has no dataset_id parameter even though the server accepts one (serve.py:1360), so SDK users cannot train on a server-side stored dataset.
  • pick() (remote.py:126) ranks servers on running+pending+gpus and ignores the workers field that capacity() adds (serve.py:457), so a hub with idle workers ranks as busy. The docstring at remote.py:10 also omits workers from the documented health shape.

frontend/src/api.ts:

  • submitFinetune(body: object) at api.ts:197 leaves the most important POST body untyped. Real fields per Train.tsx:221-224: base_model, name, config, dataset_id, eval_dataset, worker, load_in_4bit, max_seq_length.
  • getHealth (api.ts:119) is typed {ok, backend, version} but the server also returns gpus, running, pending, workers, so fleet capacity is invisible to the typed client.
  • login (api.ts:104) drops the user and expires fields the server returns (serve.py:1348).
  • The MethodInfo.adapter union comment at api.ts:41 is missing more_plus (methods/base.py:17).

Minor: comment at serve.py:841 says target="<worker name>" but the actual field is worker (serve.py:835).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions