Commit 653ea81
authored
release: graphn 0.1.6 (LoRA support + custom-model update endpoint) (#16)
Two spec-sync PRs (#12 on 2026-05-14, #15 on 2026-05-16) landed
regenerated _generated/ on main but neither bumped pyproject, so
the new control-plane surface has been sitting in the source tree
unreleased on PyPI for a week. This PR closes the gap: bumps to
0.1.6, ships matching ergonomic wrappers + typed fields on the
hand-curated resource layer, and adds tests so the new surface is
covered, not just compiled.
New high-level surface on client.custom_models (sync + async):
- update(model_id, *, name=..., min_replicas=..., max_replicas=...,
cooldown_seconds=..., extra=...) issues PATCH /v1/{ws}/custom-models/{id}.
In-place mutation of the live deployment - no rolling restart, no
downtime. Empty PATCH is refused client-side with
ValidationError(code="empty_update") one round-trip earlier than
the server's 422; an `extra` mapping lets callers PATCH future
fields without an SDK release.
- supported_architectures() returns a typed SupportedArchitectures
catalog from GET /v1/{ws}/custom-models/supported-architectures.
Each ArchitectureInfo carries the capability tags (tool_calling,
vision, image_input, video_input, streaming, json_mode) the
architecture exposes. Intended for driving UI architecture/
capability filters before calling validate().
- create(..., base_model_id=...) wires up the LoRA-import hint.
Required on weight_source=s3_* to classify the bundle as an
adapter at create-time; optional on weight_source=huggingface
where it overrides adapter_config.json::base_model_name_or_path
from the upstream repo (useful when the recorded base id isn't
a valid HF id, e.g. a local filesystem path used during training).
- validate(..., model_size_gb=...) lets callers skip the HF
head-bytes probe by supplying a weight-size hint, useful for
very large models (405B-class) where the probe stalls validate.
Typed LoRA fields on the existing Pydantic types:
- CustomModel: artifact_type ("base"|"lora"|None), base_model_id,
lora_adapter_name, lora_rank. artifact_type is None on responses
from control planes that predate the LoRA work - treat that as
"base" for compatibility.
- ValidateModelResponse: artifact_type (defaults to "base" on
fresh responses, None on legacy), detected_base_model_id,
lora_rank. When artifact_type == "lora", the architectures /
num_params / estimated_memory_gb / max_context_length fields
describe the base model resolved from adapter_config.json, not
the adapter itself.
New public exports: ArchitectureInfo, SupportedArchitectures,
ArtifactType from graphn (and graphn.custom_models).
CustomModelCreate.huggingface_model_id is now required on the
generated attrs dataclass (was str | Unset). The server has
returned 422 for omitted huggingface_model_id on every weight
source since 0.1.3 (voltagepark/takao#1997) and the hand-curated
client.custom_models.create resource raises ValidationError
client-side for S3 imports, so this is the generated type catching
up - callers using the keyword-only ergonomic API are unaffected.
Tests: 57 pass (43 existing + 14 new) covering both transports.
ruff check clean. mypy is clean on every file this PR touches
(pre-existing no-any-return errors in _transport.py and tts.py are
on main and not regressions). The auto-tag job's CHANGELOG check
matches "## [0.1.6] - 2026-05-21" so PyPI publish fires automatically
on merge.1 parent c42e87e commit 653ea81
7 files changed
Lines changed: 601 additions & 2 deletions
File tree
- src/graphn
- custom_models
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
24 | 111 | | |
25 | 112 | | |
26 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments