@tuned-tensor/cli 0.26.2 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/index.js +239 -103
- package/dist/index.js.map +1 -1
- package/docs/local-runtime/decision.md +2 -1
- package/docs/local-runtime/hosting.md +121 -0
- package/package.json +1 -1
- package/training/serving/uv.lock +3 -3
|
@@ -135,7 +135,8 @@ print(answer["choice"], answer["probabilities"])
|
|
|
135
135
|
Pass the same instructions and criteria the model was trained with: they are
|
|
136
136
|
part of its input. `resolved-workflow.json` records them under `question`.
|
|
137
137
|
The tuned model is not registered with `tt models` and is not served through
|
|
138
|
-
vLLM.
|
|
138
|
+
vLLM. To move inference off your machine, use [serverless hosting](hosting.md)
|
|
139
|
+
with `tt cloud endpoints create`.
|
|
139
140
|
|
|
140
141
|
## Limits
|
|
141
142
|
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Host a decision model
|
|
2
|
+
|
|
3
|
+
Use a serverless endpoint when a small decision model receives occasional
|
|
4
|
+
requests and you want to keep it off your own machine. Hosting currently supports
|
|
5
|
+
the pinned English Laya base checkpoint and complete TT decision fine-tunes.
|
|
6
|
+
GPU models, adapters, custom tokenizers and custom calibration are not supported.
|
|
7
|
+
The endpoint uses 6 GB of CPU memory and scales to zero when idle; the first
|
|
8
|
+
request after an idle period may be slow or fail while it starts.
|
|
9
|
+
|
|
10
|
+
You need a TT account token and prepaid credits. Your application does not need
|
|
11
|
+
AWS credentials. The hosted API must be enabled by the service operator before
|
|
12
|
+
these commands work.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
tt auth login
|
|
16
|
+
tt balance
|
|
17
|
+
# Use a completed decision run's checkpoint.
|
|
18
|
+
tt cloud endpoints create \
|
|
19
|
+
--model .tuned-tensor/decision-runs/<run-id>/train/model \
|
|
20
|
+
--name support-triage
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The command uploads only `model.safetensors` (at most 2 GB), without loading it
|
|
24
|
+
into a model runtime. The serving image supplies the trusted Laya architecture
|
|
25
|
+
and tokenizer. You do not need to upload the base model as well. To host the base
|
|
26
|
+
model instead, point `--model` at its local checkpoint directory. There is no
|
|
27
|
+
question or other inference configuration attached to a deployment. Send the
|
|
28
|
+
complete model request each time you invoke it.
|
|
29
|
+
|
|
30
|
+
Save the endpoint ID, HTTPS inference URL and inference key returned by create.
|
|
31
|
+
The key is shown only once. It can invoke only this endpoint; your account token
|
|
32
|
+
continues to manage it. Check status until it reports `ready`:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
tt cloud endpoints get <endpoint-id>
|
|
36
|
+
tt cloud endpoints list
|
|
37
|
+
tt cloud endpoints invoke <endpoint-id> --payload request.json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For the current Laya runtime, `request.json` contains both the input and question:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"input": "My card payment was declined",
|
|
45
|
+
"question": {
|
|
46
|
+
"type": "choice",
|
|
47
|
+
"instructions": "Which support queue should handle this message?",
|
|
48
|
+
"criteria": {
|
|
49
|
+
"lost_card": "A lost or stolen bank card",
|
|
50
|
+
"payment_declined": "A refused card payment"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You may send a different question on the next request. The CLI sends this JSON
|
|
57
|
+
object as-is; model-specific fields belong in the request, not deployment options.
|
|
58
|
+
The hosting API bounds requests to 128 KiB; Laya validates its own fields.
|
|
59
|
+
|
|
60
|
+
Each successful request costs the fixed number of US cents displayed at creation.
|
|
61
|
+
The price stays fixed for that endpoint. Failed requests are refunded. This
|
|
62
|
+
feature does not debit an idle compute or deployment fee; the operator still
|
|
63
|
+
incurs AWS storage and related costs. Use `tt balance` and `tt balance --help`
|
|
64
|
+
for your account balance and billing commands. Each account may have five
|
|
65
|
+
non-deleted endpoints and create at most ten endpoints in 24 hours.
|
|
66
|
+
|
|
67
|
+
A request has an idempotency UUID, printed by `invoke`. If a connection drops or
|
|
68
|
+
the API says the request is still running, retry the **same complete payload** with that ID:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
tt cloud endpoints invoke <endpoint-id> --payload request.json \
|
|
72
|
+
--request-id <original-request-uuid>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Replays return the recorded answer without a second charge. Reusing the ID with
|
|
76
|
+
a different payload (including question or options) is rejected. A failed/refunded request remains failed; use a new
|
|
77
|
+
ID for a fresh attempt. Interrupted requests are refunded by periodic recovery
|
|
78
|
+
within roughly 15 minutes. For Laya, input text is limited to 8192 characters; each request
|
|
79
|
+
includes the question it should answer. After three failures in five
|
|
80
|
+
minutes, wait five minutes before a new attempt. After 100 failures across the
|
|
81
|
+
account in 24 hours, new requests pause until earlier failures age out; cached
|
|
82
|
+
replays remain available.
|
|
83
|
+
|
|
84
|
+
For another application, call the URL from its backend:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
curl "$TT_INFERENCE_URL" \
|
|
88
|
+
-H "Authorization: Bearer $TT_INFERENCE_KEY" \
|
|
89
|
+
-H "Idempotency-Key: $(uuidgen)" \
|
|
90
|
+
-H "Content-Type: application/json" \
|
|
91
|
+
--data-binary @request.json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The response's `data.result` is Laya's typed answer with probabilities. Store keys
|
|
95
|
+
in your backend's secret storage; do not put them in public browser code. The
|
|
96
|
+
service stores results for idempotent replay and request hashes rather than the request
|
|
97
|
+
body. You can also open **Dashboard → Endpoints**, choose your endpoint, and click
|
|
98
|
+
**Generate new inference key**. Confirm replacement, then copy the new key shown
|
|
99
|
+
once. The old key stops working immediately; update your backend's secret.
|
|
100
|
+
This page also lets you copy the inference URL and refresh deployment status.
|
|
101
|
+
Settings continues to manage account access tokens, which have broader access.
|
|
102
|
+
|
|
103
|
+
Endpoint keys can also be rotated from the CLI:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
tt cloud endpoints rotate-key <endpoint-id>
|
|
107
|
+
tt cloud endpoints delete <endpoint-id>
|
|
108
|
+
tt cloud endpoints get <endpoint-id>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Deletion immediately blocks new requests. Cleanup removes the model, weights
|
|
112
|
+
and SageMaker resources asynchronously; an endpoint still provisioning must finish
|
|
113
|
+
that transition before AWS permits deletion. Late uploads go to temporary storage
|
|
114
|
+
with automatic expiry and cannot recreate the serving artifact. Poll until
|
|
115
|
+
`deleted`. Uploads abandoned for an hour, deployments that cannot become ready
|
|
116
|
+
within an hour, and failed endpoints older than a day are cleaned automatically.
|
|
117
|
+
Account deletion requires endpoint cleanup and accepted requests to finish.
|
|
118
|
+
|
|
119
|
+
If creation fails after returning an endpoint ID, inspect that ID or delete it.
|
|
120
|
+
If a deployment exists but the one-time key was lost, rotate it. Do not repeat
|
|
121
|
+
`create` simply to retrieve the key: that allocates another endpoint.
|
package/package.json
CHANGED
package/training/serving/uv.lock
CHANGED
|
@@ -457,11 +457,11 @@ wheels = [
|
|
|
457
457
|
|
|
458
458
|
[[package]]
|
|
459
459
|
name = "dnspython"
|
|
460
|
-
version = "2.
|
|
460
|
+
version = "2.9.0"
|
|
461
461
|
source = { registry = "https://pypi.org/simple" }
|
|
462
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
462
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ef/4a/50822184bd67cc6493f0fb6a880749158fcd31ab3fa07409acfd91f9fc85/dnspython-2.9.0.tar.gz", hash = "sha256:b44dc6b18f07a8b1c56676a19fbfdb5209415b046a9cece286baafa87ff3f7f1", size = 423560, upload-time = "2026-10-09T00:07:24.352Z" }
|
|
463
463
|
wheels = [
|
|
464
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
464
|
+
{ url = "https://files.pythonhosted.org/packages/10/02/cdcc9b7c051786a103c3b09e1003a82fa0c66bcb91ffbdabcfbf7b4163b9/dnspython-2.9.0-py3-none-any.whl", hash = "sha256:9a4aedb833c3c1b49214d04d44d3032ab7a9135f7c1d29a549b4ff78fd82fda9", size = 354822, upload-time = "2026-10-09T00:07:22.622Z" },
|
|
465
465
|
]
|
|
466
466
|
|
|
467
467
|
[[package]]
|