openpond-sdk 0.1.0 → 0.1.2
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/LEARNING.md +6 -0
- package/TRAINING_PROTOCOL.md +9 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +2 -2
- package/dist/learning.js +21 -0
- package/dist/learning.js.map +2 -2
- package/dist/model-projects.js +50 -0
- package/dist/model-projects.js.map +2 -2
- package/dist/training.js +22 -0
- package/dist/training.js.map +2 -2
- package/dist/types/packages/sdk/src/learning.d.ts +22 -0
- package/dist/types/packages/sdk/src/learning.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/model-projects.d.ts +191 -0
- package/dist/types/packages/sdk/src/model-projects.d.ts.map +1 -1
- package/package.json +1 -1
package/LEARNING.md
CHANGED
|
@@ -42,3 +42,9 @@ historical batches.
|
|
|
42
42
|
All client requests support an optional `AbortSignal`. Aborting a request does
|
|
43
43
|
not cancel remote compute; use `cancel_grade` and read the authoritative terminal
|
|
44
44
|
job state. Page through list responses with `nextCursor` as `afterId`.
|
|
45
|
+
|
|
46
|
+
## Publish a reviewed batch to a hosted model
|
|
47
|
+
|
|
48
|
+
Call `learning.publishBatch({ batchId, modelProjectId })` against the hosted API after sealing an approved batch. This stores its immutable Taskset package and attaches the exact release to the model. It does not start training. The service authorizes the model and batch in the same team and deduplicates publication by release identity.
|
|
49
|
+
|
|
50
|
+
Model configuration can save `trainingSetup.rewardBindingRef` before selecting a Taskset. The reference pins a binding ID, revision and content hash; task compatibility and training readiness remain separate checks. Use `createModelProjectSaveRequest` with `createModelProjectsClient().checkConfiguration()` / `.saveConfiguration()` for hosted configuration operations, and `configurationCandidates()` for available starting models. Keep one request identity for transport retries.
|
package/TRAINING_PROTOCOL.md
CHANGED
|
@@ -33,6 +33,15 @@ their placement, worker, lease, credential, or storage internals.
|
|
|
33
33
|
|
|
34
34
|
## Required provider routes
|
|
35
35
|
|
|
36
|
+
`ModelProjectConfigurationCheckSchema` describes a read-only configuration check.
|
|
37
|
+
Its `configurationHash` covers the editable Model and expected revision through
|
|
38
|
+
`modelProjectConfigurationHash`; `canSave` and bounded findings describe the
|
|
39
|
+
server's resource checks at `checkedAt`. Deferred base-model and Taskset choices
|
|
40
|
+
are explicit. This receipt does not certify training readiness, Reward quality,
|
|
41
|
+
or candidate performance and does not authorize compute. Desktop exposes the
|
|
42
|
+
check at `POST /v1/training/models/check` with a `ModelProjectSaveRequest` body.
|
|
43
|
+
Hosted configuration checking is adopted separately from the V2 sync routes.
|
|
44
|
+
|
|
36
45
|
```text
|
|
37
46
|
GET /v1/training/capabilities
|
|
38
47
|
POST /v1/training/artifacts
|
package/dist/index.js
CHANGED
|
@@ -2708,6 +2708,8 @@ function requiredId(value, label) {
|
|
|
2708
2708
|
// src/learning.ts
|
|
2709
2709
|
var learning_exports = {};
|
|
2710
2710
|
__export(learning_exports, {
|
|
2711
|
+
LearningBatchPublicationResultSchema: () => LearningBatchPublicationResultSchema,
|
|
2712
|
+
LearningBatchPublicationSchema: () => LearningBatchPublicationSchema,
|
|
2711
2713
|
OpenPondLearningClient: () => OpenPondLearningClient,
|
|
2712
2714
|
OpenPondLearningError: () => OpenPondLearningError
|
|
2713
2715
|
});
|
|
@@ -2724,6 +2726,18 @@ import {
|
|
|
2724
2726
|
import { assertBoundedTaskJson } from "@openpond/evals/task-schema";
|
|
2725
2727
|
import * as learning_star from "@openpond/evals/learning";
|
|
2726
2728
|
import * as rewards_star from "@openpond/evals/rewards";
|
|
2729
|
+
var LearningBatchPublicationSchema = z.object({
|
|
2730
|
+
batchId: z.string().trim().min(1).max(500),
|
|
2731
|
+
modelProjectId: z.string().trim().min(1).max(500)
|
|
2732
|
+
}).strict();
|
|
2733
|
+
var LearningBatchPublicationResultSchema = z.object({
|
|
2734
|
+
batchId: z.string().min(1),
|
|
2735
|
+
projectId: z.string().min(1),
|
|
2736
|
+
tasksetId: z.string().min(1),
|
|
2737
|
+
releaseId: z.string().min(1),
|
|
2738
|
+
revision: z.number().int().positive(),
|
|
2739
|
+
contentHash: z.string().regex(/^[a-f0-9]{64}$/)
|
|
2740
|
+
}).strict();
|
|
2727
2741
|
var OpenPondLearningError = class extends Error {
|
|
2728
2742
|
constructor(status, code, message, details) {
|
|
2729
2743
|
super(message);
|
|
@@ -2765,6 +2779,13 @@ var OpenPondLearningClient = class {
|
|
|
2765
2779
|
const request = LearningReadRequestSchema.parse({ action: "list", scope: this.#options.scope, kind, ...query });
|
|
2766
2780
|
return z.object({ items: z.array(learningResourceSchemas[kind]).max(100), nextCursor: z.string().nullable() }).strict().parse(await this.#request("read", request, options));
|
|
2767
2781
|
}
|
|
2782
|
+
/** Hosted publication only: stores an immutable package and attaches it, without starting training. */
|
|
2783
|
+
async publishBatch(input, options = {}) {
|
|
2784
|
+
const request = LearningBatchPublicationSchema.parse(input);
|
|
2785
|
+
const result = LearningBatchPublicationResultSchema.parse(await this.#request("publish-batch", { ...request, scope: this.#options.scope }, options));
|
|
2786
|
+
if (result.batchId !== request.batchId) throw new OpenPondLearningError(502, "batch_identity_mismatch", "Published batch response did not match the requested batch.", null);
|
|
2787
|
+
return result;
|
|
2788
|
+
}
|
|
2768
2789
|
async #request(endpoint, body, options) {
|
|
2769
2790
|
assertBoundedTaskJson(body, 16777216);
|
|
2770
2791
|
const response = await (this.#options.fetch ?? globalThis.fetch)(`${this.#options.baseUrl}/v1/learning/${endpoint}`, {
|