@abliteration/sdk 0.1.5 → 0.1.7
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/.openapi-generator/FILES +20 -0
- package/README.md +14 -0
- package/dist/apis/ModelsApi.d.ts +217 -0
- package/dist/apis/ModelsApi.js +225 -1
- package/dist/esm/apis/ModelsApi.d.ts +217 -0
- package/dist/esm/apis/ModelsApi.js +224 -0
- package/dist/esm/models/DeletionSummary.d.ts +52 -0
- package/dist/esm/models/DeletionSummary.js +53 -0
- package/dist/esm/models/DeletionSummaryTimelineInner.d.ts +34 -0
- package/dist/esm/models/DeletionSummaryTimelineInner.js +43 -0
- package/dist/esm/models/DeletionSummaryTopByDownloadsInner.d.ts +42 -0
- package/dist/esm/models/DeletionSummaryTopByDownloadsInner.js +47 -0
- package/dist/esm/models/GetHistoricalDeletionSummary200Response.d.ts +67 -0
- package/dist/esm/models/GetHistoricalDeletionSummary200Response.js +79 -0
- package/dist/esm/models/GetModelReadmeAt200Response.d.ts +67 -0
- package/dist/esm/models/GetModelReadmeAt200Response.js +79 -0
- package/dist/esm/models/HistoricalDeletion.d.ts +50 -0
- package/dist/esm/models/HistoricalDeletion.js +51 -0
- package/dist/esm/models/ListHistoricalDeletions200Response.d.ts +67 -0
- package/dist/esm/models/ListHistoricalDeletions200Response.js +79 -0
- package/dist/esm/models/ListModelReadmeDrifts200Response.d.ts +67 -0
- package/dist/esm/models/ListModelReadmeDrifts200Response.js +79 -0
- package/dist/esm/models/ReadmeAt.d.ts +38 -0
- package/dist/esm/models/ReadmeAt.js +45 -0
- package/dist/esm/models/ReadmeDrift.d.ts +46 -0
- package/dist/esm/models/ReadmeDrift.js +49 -0
- package/dist/esm/models/index.d.ts +10 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/models/DeletionSummary.d.ts +52 -0
- package/dist/models/DeletionSummary.js +60 -0
- package/dist/models/DeletionSummaryTimelineInner.d.ts +34 -0
- package/dist/models/DeletionSummaryTimelineInner.js +50 -0
- package/dist/models/DeletionSummaryTopByDownloadsInner.d.ts +42 -0
- package/dist/models/DeletionSummaryTopByDownloadsInner.js +54 -0
- package/dist/models/GetHistoricalDeletionSummary200Response.d.ts +67 -0
- package/dist/models/GetHistoricalDeletionSummary200Response.js +87 -0
- package/dist/models/GetModelReadmeAt200Response.d.ts +67 -0
- package/dist/models/GetModelReadmeAt200Response.js +87 -0
- package/dist/models/HistoricalDeletion.d.ts +50 -0
- package/dist/models/HistoricalDeletion.js +58 -0
- package/dist/models/ListHistoricalDeletions200Response.d.ts +67 -0
- package/dist/models/ListHistoricalDeletions200Response.js +87 -0
- package/dist/models/ListModelReadmeDrifts200Response.d.ts +67 -0
- package/dist/models/ListModelReadmeDrifts200Response.js +87 -0
- package/dist/models/ReadmeAt.d.ts +38 -0
- package/dist/models/ReadmeAt.js +52 -0
- package/dist/models/ReadmeDrift.d.ts +46 -0
- package/dist/models/ReadmeDrift.js +56 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +10 -0
- package/docs/DeletionSummary.md +45 -0
- package/docs/DeletionSummaryTimelineInner.md +36 -0
- package/docs/DeletionSummaryTopByDownloadsInner.md +40 -0
- package/docs/GetHistoricalDeletionSummary200Response.md +48 -0
- package/docs/GetModelReadmeAt200Response.md +48 -0
- package/docs/HistoricalDeletion.md +44 -0
- package/docs/ListHistoricalDeletions200Response.md +48 -0
- package/docs/ListModelReadmeDrifts200Response.md +48 -0
- package/docs/ModelsApi.md +321 -0
- package/docs/ReadmeAt.md +39 -0
- package/docs/ReadmeDrift.md +43 -0
- package/package.json +1 -1
- package/src/apis/ModelsApi.ts +436 -0
- package/src/models/DeletionSummary.ts +108 -0
- package/src/models/DeletionSummaryTimelineInner.ts +69 -0
- package/src/models/DeletionSummaryTopByDownloadsInner.ts +81 -0
- package/src/models/GetHistoricalDeletionSummary200Response.ts +132 -0
- package/src/models/GetModelReadmeAt200Response.ts +132 -0
- package/src/models/HistoricalDeletion.ts +93 -0
- package/src/models/ListHistoricalDeletions200Response.ts +132 -0
- package/src/models/ListModelReadmeDrifts200Response.ts +132 -0
- package/src/models/ReadmeAt.ts +75 -0
- package/src/models/ReadmeDrift.ts +87 -0
- package/src/models/index.ts +10 -0
package/src/apis/ModelsApi.ts
CHANGED
|
@@ -13,16 +13,36 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type GetHistoricalDeletionSummary200Response,
|
|
18
|
+
GetHistoricalDeletionSummary200ResponseFromJSON,
|
|
19
|
+
GetHistoricalDeletionSummary200ResponseToJSON,
|
|
20
|
+
} from '../models/GetHistoricalDeletionSummary200Response';
|
|
16
21
|
import {
|
|
17
22
|
type GetModel200Response,
|
|
18
23
|
GetModel200ResponseFromJSON,
|
|
19
24
|
GetModel200ResponseToJSON,
|
|
20
25
|
} from '../models/GetModel200Response';
|
|
26
|
+
import {
|
|
27
|
+
type GetModelReadmeAt200Response,
|
|
28
|
+
GetModelReadmeAt200ResponseFromJSON,
|
|
29
|
+
GetModelReadmeAt200ResponseToJSON,
|
|
30
|
+
} from '../models/GetModelReadmeAt200Response';
|
|
21
31
|
import {
|
|
22
32
|
type ListDelistedModels200Response,
|
|
23
33
|
ListDelistedModels200ResponseFromJSON,
|
|
24
34
|
ListDelistedModels200ResponseToJSON,
|
|
25
35
|
} from '../models/ListDelistedModels200Response';
|
|
36
|
+
import {
|
|
37
|
+
type ListHistoricalDeletions200Response,
|
|
38
|
+
ListHistoricalDeletions200ResponseFromJSON,
|
|
39
|
+
ListHistoricalDeletions200ResponseToJSON,
|
|
40
|
+
} from '../models/ListHistoricalDeletions200Response';
|
|
41
|
+
import {
|
|
42
|
+
type ListModelReadmeDrifts200Response,
|
|
43
|
+
ListModelReadmeDrifts200ResponseFromJSON,
|
|
44
|
+
ListModelReadmeDrifts200ResponseToJSON,
|
|
45
|
+
} from '../models/ListModelReadmeDrifts200Response';
|
|
26
46
|
import {
|
|
27
47
|
type ListModels200Response,
|
|
28
48
|
ListModels200ResponseFromJSON,
|
|
@@ -36,6 +56,17 @@ export interface GetModelRequest {
|
|
|
36
56
|
id: string;
|
|
37
57
|
}
|
|
38
58
|
|
|
59
|
+
export interface GetModelReadmeAtRequest {
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* HF commit sha for the README, from /drifts.
|
|
66
|
+
*/
|
|
67
|
+
commit: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
39
70
|
export interface ListDelistedModelsRequest {
|
|
40
71
|
/**
|
|
41
72
|
* ISO-8601 date or timestamp. Rows with last_seen_at >= since only. Use your previous poll's newest last_seen_at to build an incremental feed.
|
|
@@ -55,6 +86,48 @@ export interface ListDelistedModelsRequest {
|
|
|
55
86
|
offset?: number;
|
|
56
87
|
}
|
|
57
88
|
|
|
89
|
+
export interface ListHistoricalDeletionsRequest {
|
|
90
|
+
/**
|
|
91
|
+
* ISO YYYY-MM. Rows with last_seen_month >= it only.
|
|
92
|
+
*/
|
|
93
|
+
sinceMonth?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Only rows whose peak downloads >= this. `casualties over N` queries.
|
|
96
|
+
*/
|
|
97
|
+
minPeakDownloads?: number;
|
|
98
|
+
/**
|
|
99
|
+
* `downloads` (default, biggest first), `recent` (newest last_seen_month first), `lifespan` (longest-lived first).
|
|
100
|
+
*/
|
|
101
|
+
sort?: ListHistoricalDeletionsSortEnum;
|
|
102
|
+
/**
|
|
103
|
+
* Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
104
|
+
*/
|
|
105
|
+
limit?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Rows to skip. Negative and non-numeric values are treated as 0.
|
|
108
|
+
*/
|
|
109
|
+
offset?: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ListModelReadmeDriftsRequest {
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
id: string;
|
|
117
|
+
/**
|
|
118
|
+
* Unix epoch seconds. Rows with commit_ts >= it only.
|
|
119
|
+
*/
|
|
120
|
+
sinceTs?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
123
|
+
*/
|
|
124
|
+
limit?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Rows to skip. Negative and non-numeric values are treated as 0.
|
|
127
|
+
*/
|
|
128
|
+
offset?: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
58
131
|
export interface ListModelsRequest {
|
|
59
132
|
/**
|
|
60
133
|
* M-code, case-insensitive. See GET /api/v1/methods.
|
|
@@ -113,6 +186,28 @@ export interface ListModelsRequest {
|
|
|
113
186
|
* @interface ModelsApiInterface
|
|
114
187
|
*/
|
|
115
188
|
export interface ModelsApiInterface {
|
|
189
|
+
/**
|
|
190
|
+
* Creates request options for getHistoricalDeletionSummary without sending the request
|
|
191
|
+
* @throws {RequiredError}
|
|
192
|
+
* @memberof ModelsApiInterface
|
|
193
|
+
*/
|
|
194
|
+
getHistoricalDeletionSummaryRequestOpts(): Promise<runtime.RequestOpts>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
|
|
198
|
+
* @summary Historical deletions — aggregate summary
|
|
199
|
+
* @param {*} [options] Override http request option.
|
|
200
|
+
* @throws {RequiredError}
|
|
201
|
+
* @memberof ModelsApiInterface
|
|
202
|
+
*/
|
|
203
|
+
getHistoricalDeletionSummaryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetHistoricalDeletionSummary200Response>>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
|
|
207
|
+
* Historical deletions — aggregate summary
|
|
208
|
+
*/
|
|
209
|
+
getHistoricalDeletionSummary(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetHistoricalDeletionSummary200Response>;
|
|
210
|
+
|
|
116
211
|
/**
|
|
117
212
|
* Creates request options for getModel without sending the request
|
|
118
213
|
* @param {string} id
|
|
@@ -137,6 +232,32 @@ export interface ModelsApiInterface {
|
|
|
137
232
|
*/
|
|
138
233
|
getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModel200Response>;
|
|
139
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Creates request options for getModelReadmeAt without sending the request
|
|
237
|
+
* @param {string} id
|
|
238
|
+
* @param {string} commit HF commit sha for the README, from /drifts.
|
|
239
|
+
* @throws {RequiredError}
|
|
240
|
+
* @memberof ModelsApiInterface
|
|
241
|
+
*/
|
|
242
|
+
getModelReadmeAtRequestOpts(requestParameters: GetModelReadmeAtRequest): Promise<runtime.RequestOpts>;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
|
|
246
|
+
* @summary README content at one commit (wayback)
|
|
247
|
+
* @param {string} id
|
|
248
|
+
* @param {string} commit HF commit sha for the README, from /drifts.
|
|
249
|
+
* @param {*} [options] Override http request option.
|
|
250
|
+
* @throws {RequiredError}
|
|
251
|
+
* @memberof ModelsApiInterface
|
|
252
|
+
*/
|
|
253
|
+
getModelReadmeAtRaw(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModelReadmeAt200Response>>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
|
|
257
|
+
* README content at one commit (wayback)
|
|
258
|
+
*/
|
|
259
|
+
getModelReadmeAt(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelReadmeAt200Response>;
|
|
260
|
+
|
|
140
261
|
/**
|
|
141
262
|
* Creates request options for listDelistedModels without sending the request
|
|
142
263
|
* @param {string} [since] ISO-8601 date or timestamp. Rows with last_seen_at >= since only. Use your previous poll\'s newest last_seen_at to build an incremental feed.
|
|
@@ -167,6 +288,68 @@ export interface ModelsApiInterface {
|
|
|
167
288
|
*/
|
|
168
289
|
listDelistedModels(requestParameters: ListDelistedModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDelistedModels200Response>;
|
|
169
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Creates request options for listHistoricalDeletions without sending the request
|
|
293
|
+
* @param {string} [sinceMonth] ISO YYYY-MM. Rows with last_seen_month >= it only.
|
|
294
|
+
* @param {number} [minPeakDownloads] Only rows whose peak downloads >= this. `casualties over N` queries.
|
|
295
|
+
* @param {'downloads' | 'recent' | 'lifespan'} [sort] `downloads` (default, biggest first), `recent` (newest last_seen_month first), `lifespan` (longest-lived first).
|
|
296
|
+
* @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
297
|
+
* @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
|
|
298
|
+
* @throws {RequiredError}
|
|
299
|
+
* @memberof ModelsApiInterface
|
|
300
|
+
*/
|
|
301
|
+
listHistoricalDeletionsRequestOpts(requestParameters: ListHistoricalDeletionsRequest): Promise<runtime.RequestOpts>;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (`downloads`, default), recency (`recent`, newest deaths first) or lifespan (`lifespan`, longest-lived first — surprising deaths).
|
|
305
|
+
* @summary Historical deletions — paged list
|
|
306
|
+
* @param {string} [sinceMonth] ISO YYYY-MM. Rows with last_seen_month >= it only.
|
|
307
|
+
* @param {number} [minPeakDownloads] Only rows whose peak downloads >= this. `casualties over N` queries.
|
|
308
|
+
* @param {'downloads' | 'recent' | 'lifespan'} [sort] `downloads` (default, biggest first), `recent` (newest last_seen_month first), `lifespan` (longest-lived first).
|
|
309
|
+
* @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
310
|
+
* @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
|
|
311
|
+
* @param {*} [options] Override http request option.
|
|
312
|
+
* @throws {RequiredError}
|
|
313
|
+
* @memberof ModelsApiInterface
|
|
314
|
+
*/
|
|
315
|
+
listHistoricalDeletionsRaw(requestParameters: ListHistoricalDeletionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListHistoricalDeletions200Response>>;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (`downloads`, default), recency (`recent`, newest deaths first) or lifespan (`lifespan`, longest-lived first — surprising deaths).
|
|
319
|
+
* Historical deletions — paged list
|
|
320
|
+
*/
|
|
321
|
+
listHistoricalDeletions(requestParameters: ListHistoricalDeletionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListHistoricalDeletions200Response>;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Creates request options for listModelReadmeDrifts without sending the request
|
|
325
|
+
* @param {string} id
|
|
326
|
+
* @param {number} [sinceTs] Unix epoch seconds. Rows with commit_ts >= it only.
|
|
327
|
+
* @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
328
|
+
* @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
|
|
329
|
+
* @throws {RequiredError}
|
|
330
|
+
* @memberof ModelsApiInterface
|
|
331
|
+
*/
|
|
332
|
+
listModelReadmeDriftsRequestOpts(requestParameters: ListModelReadmeDriftsRequest): Promise<runtime.RequestOpts>;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Cost: 5 credits, flat. Every commit that changed the model\'s README on HF, with `size_delta` between commits so a consumer spots growth spurts and hard prunes without fetching each version. Poll with `since_ts=<max commit_ts of your previous run>` for an incremental drift feed.
|
|
336
|
+
* @summary README drift stream for one model
|
|
337
|
+
* @param {string} id
|
|
338
|
+
* @param {number} [sinceTs] Unix epoch seconds. Rows with commit_ts >= it only.
|
|
339
|
+
* @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
340
|
+
* @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
|
|
341
|
+
* @param {*} [options] Override http request option.
|
|
342
|
+
* @throws {RequiredError}
|
|
343
|
+
* @memberof ModelsApiInterface
|
|
344
|
+
*/
|
|
345
|
+
listModelReadmeDriftsRaw(requestParameters: ListModelReadmeDriftsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListModelReadmeDrifts200Response>>;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Cost: 5 credits, flat. Every commit that changed the model\'s README on HF, with `size_delta` between commits so a consumer spots growth spurts and hard prunes without fetching each version. Poll with `since_ts=<max commit_ts of your previous run>` for an incremental drift feed.
|
|
349
|
+
* README drift stream for one model
|
|
350
|
+
*/
|
|
351
|
+
listModelReadmeDrifts(requestParameters: ListModelReadmeDriftsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListModelReadmeDrifts200Response>;
|
|
352
|
+
|
|
170
353
|
/**
|
|
171
354
|
* Creates request options for listModels without sending the request
|
|
172
355
|
* @param {string} [method] M-code, case-insensitive. See GET /api/v1/methods.
|
|
@@ -220,6 +403,53 @@ export interface ModelsApiInterface {
|
|
|
220
403
|
*/
|
|
221
404
|
export class ModelsApi extends runtime.BaseAPI implements ModelsApiInterface {
|
|
222
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Creates request options for getHistoricalDeletionSummary without sending the request
|
|
408
|
+
*/
|
|
409
|
+
async getHistoricalDeletionSummaryRequestOpts(): Promise<runtime.RequestOpts> {
|
|
410
|
+
const queryParameters: any = {};
|
|
411
|
+
|
|
412
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
413
|
+
|
|
414
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
415
|
+
const token = this.configuration.accessToken;
|
|
416
|
+
const tokenString = await token("bearerAuth", []);
|
|
417
|
+
|
|
418
|
+
if (tokenString) {
|
|
419
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
let urlPath = `/api/v1/models/historical-deletions/summary`;
|
|
424
|
+
|
|
425
|
+
return {
|
|
426
|
+
path: urlPath,
|
|
427
|
+
method: 'GET',
|
|
428
|
+
headers: headerParameters,
|
|
429
|
+
query: queryParameters,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
|
|
435
|
+
* Historical deletions — aggregate summary
|
|
436
|
+
*/
|
|
437
|
+
async getHistoricalDeletionSummaryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetHistoricalDeletionSummary200Response>> {
|
|
438
|
+
const requestOptions = await this.getHistoricalDeletionSummaryRequestOpts();
|
|
439
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
440
|
+
|
|
441
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetHistoricalDeletionSummary200ResponseFromJSON(jsonValue));
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
|
|
446
|
+
* Historical deletions — aggregate summary
|
|
447
|
+
*/
|
|
448
|
+
async getHistoricalDeletionSummary(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetHistoricalDeletionSummary200Response> {
|
|
449
|
+
const response = await this.getHistoricalDeletionSummaryRaw(initOverrides);
|
|
450
|
+
return await response.value();
|
|
451
|
+
}
|
|
452
|
+
|
|
223
453
|
/**
|
|
224
454
|
* Creates request options for getModel without sending the request
|
|
225
455
|
*/
|
|
@@ -275,6 +505,69 @@ export class ModelsApi extends runtime.BaseAPI implements ModelsApiInterface {
|
|
|
275
505
|
return await response.value();
|
|
276
506
|
}
|
|
277
507
|
|
|
508
|
+
/**
|
|
509
|
+
* Creates request options for getModelReadmeAt without sending the request
|
|
510
|
+
*/
|
|
511
|
+
async getModelReadmeAtRequestOpts(requestParameters: GetModelReadmeAtRequest): Promise<runtime.RequestOpts> {
|
|
512
|
+
if (requestParameters['id'] == null) {
|
|
513
|
+
throw new runtime.RequiredError(
|
|
514
|
+
'id',
|
|
515
|
+
'Required parameter "id" was null or undefined when calling getModelReadmeAt().'
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (requestParameters['commit'] == null) {
|
|
520
|
+
throw new runtime.RequiredError(
|
|
521
|
+
'commit',
|
|
522
|
+
'Required parameter "commit" was null or undefined when calling getModelReadmeAt().'
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
const queryParameters: any = {};
|
|
527
|
+
|
|
528
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
529
|
+
|
|
530
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
531
|
+
const token = this.configuration.accessToken;
|
|
532
|
+
const tokenString = await token("bearerAuth", []);
|
|
533
|
+
|
|
534
|
+
if (tokenString) {
|
|
535
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
let urlPath = `/api/v1/models/{id}/readme-at/{commit}`;
|
|
540
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
541
|
+
urlPath = urlPath.replace('{commit}', encodeURIComponent(String(requestParameters['commit'])));
|
|
542
|
+
|
|
543
|
+
return {
|
|
544
|
+
path: urlPath,
|
|
545
|
+
method: 'GET',
|
|
546
|
+
headers: headerParameters,
|
|
547
|
+
query: queryParameters,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
|
|
553
|
+
* README content at one commit (wayback)
|
|
554
|
+
*/
|
|
555
|
+
async getModelReadmeAtRaw(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModelReadmeAt200Response>> {
|
|
556
|
+
const requestOptions = await this.getModelReadmeAtRequestOpts(requestParameters);
|
|
557
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
558
|
+
|
|
559
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetModelReadmeAt200ResponseFromJSON(jsonValue));
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
|
|
564
|
+
* README content at one commit (wayback)
|
|
565
|
+
*/
|
|
566
|
+
async getModelReadmeAt(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelReadmeAt200Response> {
|
|
567
|
+
const response = await this.getModelReadmeAtRaw(requestParameters, initOverrides);
|
|
568
|
+
return await response.value();
|
|
569
|
+
}
|
|
570
|
+
|
|
278
571
|
/**
|
|
279
572
|
* Creates request options for listDelistedModels without sending the request
|
|
280
573
|
*/
|
|
@@ -338,6 +631,140 @@ export class ModelsApi extends runtime.BaseAPI implements ModelsApiInterface {
|
|
|
338
631
|
return await response.value();
|
|
339
632
|
}
|
|
340
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Creates request options for listHistoricalDeletions without sending the request
|
|
636
|
+
*/
|
|
637
|
+
async listHistoricalDeletionsRequestOpts(requestParameters: ListHistoricalDeletionsRequest): Promise<runtime.RequestOpts> {
|
|
638
|
+
const queryParameters: any = {};
|
|
639
|
+
|
|
640
|
+
if (requestParameters['sinceMonth'] != null) {
|
|
641
|
+
queryParameters['since_month'] = requestParameters['sinceMonth'];
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
if (requestParameters['minPeakDownloads'] != null) {
|
|
645
|
+
queryParameters['min_peak_downloads'] = requestParameters['minPeakDownloads'];
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (requestParameters['sort'] != null) {
|
|
649
|
+
queryParameters['sort'] = requestParameters['sort'];
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
if (requestParameters['limit'] != null) {
|
|
653
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (requestParameters['offset'] != null) {
|
|
657
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
661
|
+
|
|
662
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
663
|
+
const token = this.configuration.accessToken;
|
|
664
|
+
const tokenString = await token("bearerAuth", []);
|
|
665
|
+
|
|
666
|
+
if (tokenString) {
|
|
667
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
let urlPath = `/api/v1/models/historical-deletions/list`;
|
|
672
|
+
|
|
673
|
+
return {
|
|
674
|
+
path: urlPath,
|
|
675
|
+
method: 'GET',
|
|
676
|
+
headers: headerParameters,
|
|
677
|
+
query: queryParameters,
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (`downloads`, default), recency (`recent`, newest deaths first) or lifespan (`lifespan`, longest-lived first — surprising deaths).
|
|
683
|
+
* Historical deletions — paged list
|
|
684
|
+
*/
|
|
685
|
+
async listHistoricalDeletionsRaw(requestParameters: ListHistoricalDeletionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListHistoricalDeletions200Response>> {
|
|
686
|
+
const requestOptions = await this.listHistoricalDeletionsRequestOpts(requestParameters);
|
|
687
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
688
|
+
|
|
689
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ListHistoricalDeletions200ResponseFromJSON(jsonValue));
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (`downloads`, default), recency (`recent`, newest deaths first) or lifespan (`lifespan`, longest-lived first — surprising deaths).
|
|
694
|
+
* Historical deletions — paged list
|
|
695
|
+
*/
|
|
696
|
+
async listHistoricalDeletions(requestParameters: ListHistoricalDeletionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListHistoricalDeletions200Response> {
|
|
697
|
+
const response = await this.listHistoricalDeletionsRaw(requestParameters, initOverrides);
|
|
698
|
+
return await response.value();
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Creates request options for listModelReadmeDrifts without sending the request
|
|
703
|
+
*/
|
|
704
|
+
async listModelReadmeDriftsRequestOpts(requestParameters: ListModelReadmeDriftsRequest): Promise<runtime.RequestOpts> {
|
|
705
|
+
if (requestParameters['id'] == null) {
|
|
706
|
+
throw new runtime.RequiredError(
|
|
707
|
+
'id',
|
|
708
|
+
'Required parameter "id" was null or undefined when calling listModelReadmeDrifts().'
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const queryParameters: any = {};
|
|
713
|
+
|
|
714
|
+
if (requestParameters['sinceTs'] != null) {
|
|
715
|
+
queryParameters['since_ts'] = requestParameters['sinceTs'];
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
if (requestParameters['limit'] != null) {
|
|
719
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (requestParameters['offset'] != null) {
|
|
723
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
727
|
+
|
|
728
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
729
|
+
const token = this.configuration.accessToken;
|
|
730
|
+
const tokenString = await token("bearerAuth", []);
|
|
731
|
+
|
|
732
|
+
if (tokenString) {
|
|
733
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
let urlPath = `/api/v1/models/{id}/drifts`;
|
|
738
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
739
|
+
|
|
740
|
+
return {
|
|
741
|
+
path: urlPath,
|
|
742
|
+
method: 'GET',
|
|
743
|
+
headers: headerParameters,
|
|
744
|
+
query: queryParameters,
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Cost: 5 credits, flat. Every commit that changed the model\'s README on HF, with `size_delta` between commits so a consumer spots growth spurts and hard prunes without fetching each version. Poll with `since_ts=<max commit_ts of your previous run>` for an incremental drift feed.
|
|
750
|
+
* README drift stream for one model
|
|
751
|
+
*/
|
|
752
|
+
async listModelReadmeDriftsRaw(requestParameters: ListModelReadmeDriftsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListModelReadmeDrifts200Response>> {
|
|
753
|
+
const requestOptions = await this.listModelReadmeDriftsRequestOpts(requestParameters);
|
|
754
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
755
|
+
|
|
756
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ListModelReadmeDrifts200ResponseFromJSON(jsonValue));
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Cost: 5 credits, flat. Every commit that changed the model\'s README on HF, with `size_delta` between commits so a consumer spots growth spurts and hard prunes without fetching each version. Poll with `since_ts=<max commit_ts of your previous run>` for an incremental drift feed.
|
|
761
|
+
* README drift stream for one model
|
|
762
|
+
*/
|
|
763
|
+
async listModelReadmeDrifts(requestParameters: ListModelReadmeDriftsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListModelReadmeDrifts200Response> {
|
|
764
|
+
const response = await this.listModelReadmeDriftsRaw(requestParameters, initOverrides);
|
|
765
|
+
return await response.value();
|
|
766
|
+
}
|
|
767
|
+
|
|
341
768
|
/**
|
|
342
769
|
* Creates request options for listModels without sending the request
|
|
343
770
|
*/
|
|
@@ -443,6 +870,15 @@ export const ListDelistedModelsSortEnum = {
|
|
|
443
870
|
Downloads: 'downloads',
|
|
444
871
|
} as const;
|
|
445
872
|
export type ListDelistedModelsSortEnum = typeof ListDelistedModelsSortEnum[keyof typeof ListDelistedModelsSortEnum];
|
|
873
|
+
/**
|
|
874
|
+
* @export
|
|
875
|
+
*/
|
|
876
|
+
export const ListHistoricalDeletionsSortEnum = {
|
|
877
|
+
Downloads: 'downloads',
|
|
878
|
+
Recent: 'recent',
|
|
879
|
+
Lifespan: 'lifespan',
|
|
880
|
+
} as const;
|
|
881
|
+
export type ListHistoricalDeletionsSortEnum = typeof ListHistoricalDeletionsSortEnum[keyof typeof ListHistoricalDeletionsSortEnum];
|
|
446
882
|
/**
|
|
447
883
|
* @export
|
|
448
884
|
*/
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* abliteration.org Public API
|
|
5
|
+
* Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { DeletionSummaryTopByDownloadsInner } from './DeletionSummaryTopByDownloadsInner';
|
|
17
|
+
import {
|
|
18
|
+
DeletionSummaryTopByDownloadsInnerFromJSON,
|
|
19
|
+
DeletionSummaryTopByDownloadsInnerFromJSONTyped,
|
|
20
|
+
DeletionSummaryTopByDownloadsInnerToJSON,
|
|
21
|
+
DeletionSummaryTopByDownloadsInnerToJSONTyped,
|
|
22
|
+
} from './DeletionSummaryTopByDownloadsInner';
|
|
23
|
+
import type { DeletionSummaryTimelineInner } from './DeletionSummaryTimelineInner';
|
|
24
|
+
import {
|
|
25
|
+
DeletionSummaryTimelineInnerFromJSON,
|
|
26
|
+
DeletionSummaryTimelineInnerFromJSONTyped,
|
|
27
|
+
DeletionSummaryTimelineInnerToJSON,
|
|
28
|
+
DeletionSummaryTimelineInnerToJSONTyped,
|
|
29
|
+
} from './DeletionSummaryTimelineInner';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Aggregate rollup of the 24-month HF deletion analysis.
|
|
33
|
+
* @export
|
|
34
|
+
* @interface DeletionSummary
|
|
35
|
+
*/
|
|
36
|
+
export interface DeletionSummary {
|
|
37
|
+
/**
|
|
38
|
+
* Live catalog size plus historical deletions.
|
|
39
|
+
*/
|
|
40
|
+
total_ever_seen?: number;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
total_deleted?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Percentage of ever-seen models that are now gone.
|
|
47
|
+
*/
|
|
48
|
+
deletion_rate_pct?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Average lifespan of deleted models, in months.
|
|
51
|
+
*/
|
|
52
|
+
avg_months_alive?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Deletions grouped by last_seen_month, ascending.
|
|
55
|
+
*/
|
|
56
|
+
timeline?: Array<DeletionSummaryTimelineInner>;
|
|
57
|
+
/**
|
|
58
|
+
* Top-10 biggest casualties by peak downloads.
|
|
59
|
+
*/
|
|
60
|
+
top_by_downloads?: Array<DeletionSummaryTopByDownloadsInner>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Check if a given object implements the DeletionSummary interface.
|
|
65
|
+
*/
|
|
66
|
+
export function instanceOfDeletionSummary(value: object): value is DeletionSummary {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function DeletionSummaryFromJSON(json: any): DeletionSummary {
|
|
71
|
+
return DeletionSummaryFromJSONTyped(json, false);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function DeletionSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeletionSummary {
|
|
75
|
+
if (json == null) {
|
|
76
|
+
return json;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
|
|
80
|
+
'total_ever_seen': json['total_ever_seen'] == null ? undefined : json['total_ever_seen'],
|
|
81
|
+
'total_deleted': json['total_deleted'] == null ? undefined : json['total_deleted'],
|
|
82
|
+
'deletion_rate_pct': json['deletion_rate_pct'] == null ? undefined : json['deletion_rate_pct'],
|
|
83
|
+
'avg_months_alive': json['avg_months_alive'] == null ? undefined : json['avg_months_alive'],
|
|
84
|
+
'timeline': json['timeline'] == null ? undefined : ((json['timeline'] as Array<any>).map(DeletionSummaryTimelineInnerFromJSON)),
|
|
85
|
+
'top_by_downloads': json['top_by_downloads'] == null ? undefined : ((json['top_by_downloads'] as Array<any>).map(DeletionSummaryTopByDownloadsInnerFromJSON)),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function DeletionSummaryToJSON(json: any): DeletionSummary {
|
|
90
|
+
return DeletionSummaryToJSONTyped(json, false);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function DeletionSummaryToJSONTyped(value?: DeletionSummary | null, ignoreDiscriminator: boolean = false): any {
|
|
94
|
+
if (value == null) {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
|
|
100
|
+
'total_ever_seen': value['total_ever_seen'],
|
|
101
|
+
'total_deleted': value['total_deleted'],
|
|
102
|
+
'deletion_rate_pct': value['deletion_rate_pct'],
|
|
103
|
+
'avg_months_alive': value['avg_months_alive'],
|
|
104
|
+
'timeline': value['timeline'] == null ? undefined : ((value['timeline'] as Array<any>).map(DeletionSummaryTimelineInnerToJSON)),
|
|
105
|
+
'top_by_downloads': value['top_by_downloads'] == null ? undefined : ((value['top_by_downloads'] as Array<any>).map(DeletionSummaryTopByDownloadsInnerToJSON)),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|