abliteration 0.1.5 → 0.1.6
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.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/docs/DelistedModel.md +30 -0
- data/docs/ListDelistedModels200Response.md +32 -0
- data/docs/ModelDetail.md +4 -0
- data/docs/ModelSummary.md +5 -1
- data/docs/ModelsApi.md +82 -2
- data/lib/abliteration/api/models_api.rb +96 -4
- data/lib/abliteration/models/delisted_model.rb +206 -0
- data/lib/abliteration/models/list_delisted_models200_response.rb +386 -0
- data/lib/abliteration/models/model_detail.rb +23 -1
- data/lib/abliteration/models/model_summary.rb +27 -5
- data/lib/abliteration/version.rb +1 -1
- data/lib/abliteration.rb +2 -0
- data/spec/models/delisted_model_spec.rb +72 -0
- data/spec/models/list_delisted_models200_response_spec.rb +82 -0
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4954feb3c086bc804c783fa545d66687cdde13f05e7601c6006d905bee95a71
|
|
4
|
+
data.tar.gz: e3f746c6712d3b344e621ed8ec1793cec6a59d2ad52a751f7d048dbda3a42680
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 450a0f75eb10f2ee3386305af5eec41eebae627c4c04b9e2ba4fc0f93c8bbd8e343f936cdd9645435664bc8b9a9f98d685b9b3456cd1d135de0dd6ca8611b105
|
|
7
|
+
data.tar.gz: da5db6f4dd8925c982278808e5c7d803a63fb510802bea3abbd0a8c9fe2bf0b142a5f67b667c4333434a96873d9102cdfe676da5689fb101ec211229799d3e27
|
data/README.md
CHANGED
|
@@ -98,6 +98,7 @@ Class | Method | HTTP request | Description
|
|
|
98
98
|
*Abliteration::MethodsApi* | [**get_method**](docs/MethodsApi.md#get_method) | **GET** /api/v1/methods/{id} | Get one method
|
|
99
99
|
*Abliteration::MethodsApi* | [**list_methods**](docs/MethodsApi.md#list_methods) | **GET** /api/v1/methods | List the method taxonomy
|
|
100
100
|
*Abliteration::ModelsApi* | [**get_model**](docs/ModelsApi.md#get_model) | **GET** /api/v1/models/{id} | Get one model
|
|
101
|
+
*Abliteration::ModelsApi* | [**list_delisted_models**](docs/ModelsApi.md#list_delisted_models) | **GET** /api/v1/models/delisted | List delisted models (change stream)
|
|
101
102
|
*Abliteration::ModelsApi* | [**list_models**](docs/ModelsApi.md#list_models) | **GET** /api/v1/models | List models
|
|
102
103
|
*Abliteration::TimelineApi* | [**list_timeline**](docs/TimelineApi.md#list_timeline) | **GET** /api/v1/timeline | Curated field events
|
|
103
104
|
|
|
@@ -109,6 +110,7 @@ Class | Method | HTTP request | Description
|
|
|
109
110
|
- [Abliteration::DaiPoint](docs/DaiPoint.md)
|
|
110
111
|
- [Abliteration::Dataset](docs/Dataset.md)
|
|
111
112
|
- [Abliteration::DatasetDetail](docs/DatasetDetail.md)
|
|
113
|
+
- [Abliteration::DelistedModel](docs/DelistedModel.md)
|
|
112
114
|
- [Abliteration::Envelope](docs/Envelope.md)
|
|
113
115
|
- [Abliteration::Error](docs/Error.md)
|
|
114
116
|
- [Abliteration::Event](docs/Event.md)
|
|
@@ -121,6 +123,7 @@ Class | Method | HTTP request | Description
|
|
|
121
123
|
- [Abliteration::IndexDetail](docs/IndexDetail.md)
|
|
122
124
|
- [Abliteration::ListAuthors200Response](docs/ListAuthors200Response.md)
|
|
123
125
|
- [Abliteration::ListDatasets200Response](docs/ListDatasets200Response.md)
|
|
126
|
+
- [Abliteration::ListDelistedModels200Response](docs/ListDelistedModels200Response.md)
|
|
124
127
|
- [Abliteration::ListIndices200Response](docs/ListIndices200Response.md)
|
|
125
128
|
- [Abliteration::ListMethods200Response](docs/ListMethods200Response.md)
|
|
126
129
|
- [Abliteration::ListModels200Response](docs/ListModels200Response.md)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Abliteration::DelistedModel
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | [optional] |
|
|
8
|
+
| **author** | **String** | | [optional] |
|
|
9
|
+
| **family** | **String** | | [optional] |
|
|
10
|
+
| **params_b** | **Float** | | [optional] |
|
|
11
|
+
| **downloads** | **Integer** | Downloads at the moment the model was last visible on HF. Not a live counter. | [optional] |
|
|
12
|
+
| **last_seen_at** | **String** | ISO-8601 timestamp of the last successful Hub observation. Approximately when the model died. | [optional] |
|
|
13
|
+
| **days_since_gone** | **Integer** | Whole days between last_seen_at and now, computed server-side for convenience. | [optional] |
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'abliteration'
|
|
19
|
+
|
|
20
|
+
instance = Abliteration::DelistedModel.new(
|
|
21
|
+
id: null,
|
|
22
|
+
author: null,
|
|
23
|
+
family: null,
|
|
24
|
+
params_b: null,
|
|
25
|
+
downloads: null,
|
|
26
|
+
last_seen_at: null,
|
|
27
|
+
days_since_gone: null
|
|
28
|
+
)
|
|
29
|
+
```
|
|
30
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Abliteration::ListDelistedModels200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**Array<DelistedModel>**](DelistedModel.md) | | |
|
|
8
|
+
| **cost** | **Integer** | Credits this call costs. | |
|
|
9
|
+
| **credits_remaining** | **Integer** | Wallet balance after the call. Unchanged while metering is preview. | |
|
|
10
|
+
| **rate_limit_limit** | **Integer** | Ceiling for the current window. Also returned as X-RateLimit-Limit. | |
|
|
11
|
+
| **rate_limit_remaining** | **Integer** | Calls left in the current window for this key. Also returned as X-RateLimit-Remaining. | |
|
|
12
|
+
| **rate_limit_reset** | **Integer** | Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset. | |
|
|
13
|
+
| **metering** | **String** | Whether cost was actually deducted. | |
|
|
14
|
+
| **request_id** | **String** | Also returned in the x-request-id header. | |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'abliteration'
|
|
20
|
+
|
|
21
|
+
instance = Abliteration::ListDelistedModels200Response.new(
|
|
22
|
+
data: null,
|
|
23
|
+
cost: null,
|
|
24
|
+
credits_remaining: null,
|
|
25
|
+
rate_limit_limit: null,
|
|
26
|
+
rate_limit_remaining: null,
|
|
27
|
+
rate_limit_reset: null,
|
|
28
|
+
metering: null,
|
|
29
|
+
request_id: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
data/docs/ModelDetail.md
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
| **last_modified** | **String** | | [optional] |
|
|
27
27
|
| **first_seen_at** | **String** | | [optional] |
|
|
28
28
|
| **last_seen_at** | **String** | | [optional] |
|
|
29
|
+
| **is_delisted** | **Integer** | 0/1 flag. `1` means HF no longer serves this model — the response is the last state we recorded. | [optional] |
|
|
30
|
+
| **days_since_gone** | **Integer** | Whole days between last_seen_at and now. `null` unless is_delisted=1. | [optional] |
|
|
29
31
|
| **readme_text** | **String** | | [optional] |
|
|
30
32
|
| **readme_status** | **String** | | [optional] |
|
|
31
33
|
| **tags** | **String** | JSON-encoded array of Hub tags. | [optional] |
|
|
@@ -82,6 +84,8 @@ instance = Abliteration::ModelDetail.new(
|
|
|
82
84
|
last_modified: null,
|
|
83
85
|
first_seen_at: null,
|
|
84
86
|
last_seen_at: null,
|
|
87
|
+
is_delisted: null,
|
|
88
|
+
days_since_gone: null,
|
|
85
89
|
readme_text: null,
|
|
86
90
|
readme_status: null,
|
|
87
91
|
tags: null,
|
data/docs/ModelSummary.md
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
| **is_gguf** | **Integer** | | [optional] |
|
|
18
18
|
| **created_at** | **String** | | [optional] |
|
|
19
19
|
| **first_seen_at** | **String** | | [optional] |
|
|
20
|
+
| **is_delisted** | **Integer** | 0/1 flag, present in every response row. `1` means the model is no longer on the Hub. | [optional] |
|
|
21
|
+
| **last_seen_at** | **String** | ISO-8601 timestamp of the last successful Hub observation. Non-null on delisted rows. | [optional] |
|
|
20
22
|
|
|
21
23
|
## Example
|
|
22
24
|
|
|
@@ -36,7 +38,9 @@ instance = Abliteration::ModelSummary.new(
|
|
|
36
38
|
likes: null,
|
|
37
39
|
is_gguf: null,
|
|
38
40
|
created_at: null,
|
|
39
|
-
first_seen_at: null
|
|
41
|
+
first_seen_at: null,
|
|
42
|
+
is_delisted: null,
|
|
43
|
+
last_seen_at: null
|
|
40
44
|
)
|
|
41
45
|
```
|
|
42
46
|
|
data/docs/ModelsApi.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://abliteration.org*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**get_model**](ModelsApi.md#get_model) | **GET** /api/v1/models/{id} | Get one model |
|
|
8
|
+
| [**list_delisted_models**](ModelsApi.md#list_delisted_models) | **GET** /api/v1/models/delisted | List delisted models (change stream) |
|
|
8
9
|
| [**list_models**](ModelsApi.md#list_models) | **GET** /api/v1/models | List models |
|
|
9
10
|
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@ All URIs are relative to *https://abliteration.org*
|
|
|
14
15
|
|
|
15
16
|
Get one model
|
|
16
17
|
|
|
17
|
-
Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded.
|
|
18
|
+
Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries `is_delisted=1` and `days_since_gone`.
|
|
18
19
|
|
|
19
20
|
### Examples
|
|
20
21
|
|
|
@@ -77,13 +78,90 @@ end
|
|
|
77
78
|
- **Accept**: application/json
|
|
78
79
|
|
|
79
80
|
|
|
81
|
+
## list_delisted_models
|
|
82
|
+
|
|
83
|
+
> <ListDelistedModels200Response> list_delisted_models(opts)
|
|
84
|
+
|
|
85
|
+
List delisted models (change stream)
|
|
86
|
+
|
|
87
|
+
Cost: 5 credits, flat. Change-stream companion to /models: every row is a tombstone — a model that HF no longer serves, preserved here at its final state. Poll with `since=<last_seen_at of your previous run>` to fetch only new casualties; callers building compliance dashboards, safety-research corpora, or \"wayback\" tools live on this endpoint. See /api#change-stream.
|
|
88
|
+
|
|
89
|
+
### Examples
|
|
90
|
+
|
|
91
|
+
```ruby
|
|
92
|
+
require 'time'
|
|
93
|
+
require 'abliteration'
|
|
94
|
+
# setup authorization
|
|
95
|
+
Abliteration.configure do |config|
|
|
96
|
+
# Configure Bearer authorization: bearerAuth
|
|
97
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
api_instance = Abliteration::ModelsApi.new
|
|
101
|
+
opts = {
|
|
102
|
+
since: 'since_example', # String | 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.
|
|
103
|
+
sort: 'recent', # String | `recent` (default, newest disappearance first) or `downloads` (biggest casualties first — best for post-mortem coverage).
|
|
104
|
+
limit: 56, # Integer | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
105
|
+
offset: 56 # Integer | Rows to skip. Negative and non-numeric values are treated as 0.
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
begin
|
|
109
|
+
# List delisted models (change stream)
|
|
110
|
+
result = api_instance.list_delisted_models(opts)
|
|
111
|
+
p result
|
|
112
|
+
rescue Abliteration::ApiError => e
|
|
113
|
+
puts "Error when calling ModelsApi->list_delisted_models: #{e}"
|
|
114
|
+
end
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Using the list_delisted_models_with_http_info variant
|
|
118
|
+
|
|
119
|
+
This returns an Array which contains the response data, status code and headers.
|
|
120
|
+
|
|
121
|
+
> <Array(<ListDelistedModels200Response>, Integer, Hash)> list_delisted_models_with_http_info(opts)
|
|
122
|
+
|
|
123
|
+
```ruby
|
|
124
|
+
begin
|
|
125
|
+
# List delisted models (change stream)
|
|
126
|
+
data, status_code, headers = api_instance.list_delisted_models_with_http_info(opts)
|
|
127
|
+
p status_code # => 2xx
|
|
128
|
+
p headers # => { ... }
|
|
129
|
+
p data # => <ListDelistedModels200Response>
|
|
130
|
+
rescue Abliteration::ApiError => e
|
|
131
|
+
puts "Error when calling ModelsApi->list_delisted_models_with_http_info: #{e}"
|
|
132
|
+
end
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Parameters
|
|
136
|
+
|
|
137
|
+
| Name | Type | Description | Notes |
|
|
138
|
+
| ---- | ---- | ----------- | ----- |
|
|
139
|
+
| **since** | **String** | 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. | [optional] |
|
|
140
|
+
| **sort** | **String** | `recent` (default, newest disappearance first) or `downloads` (biggest casualties first — best for post-mortem coverage). | [optional][default to 'recent'] |
|
|
141
|
+
| **limit** | **Integer** | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. | [optional][default to 50] |
|
|
142
|
+
| **offset** | **Integer** | Rows to skip. Negative and non-numeric values are treated as 0. | [optional][default to 0] |
|
|
143
|
+
|
|
144
|
+
### Return type
|
|
145
|
+
|
|
146
|
+
[**ListDelistedModels200Response**](ListDelistedModels200Response.md)
|
|
147
|
+
|
|
148
|
+
### Authorization
|
|
149
|
+
|
|
150
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
151
|
+
|
|
152
|
+
### HTTP request headers
|
|
153
|
+
|
|
154
|
+
- **Content-Type**: Not defined
|
|
155
|
+
- **Accept**: application/json
|
|
156
|
+
|
|
157
|
+
|
|
80
158
|
## list_models
|
|
81
159
|
|
|
82
160
|
> <ListModels200Response> list_models(opts)
|
|
83
161
|
|
|
84
162
|
List models
|
|
85
163
|
|
|
86
|
-
Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded
|
|
164
|
+
Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (`delisted=live`); pass `delisted=dead|all` to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.
|
|
87
165
|
|
|
88
166
|
### Examples
|
|
89
167
|
|
|
@@ -106,6 +184,7 @@ opts = {
|
|
|
106
184
|
downloads_lte: 56, # Integer |
|
|
107
185
|
created_after: 'created_after_example', # String | ISO-8601 date or timestamp, inclusive.
|
|
108
186
|
created_before: 'created_before_example', # String | ISO-8601 date or timestamp, inclusive.
|
|
187
|
+
delisted: 'live', # String | Tombstone filter. `live` (default): HF-visible models only. `dead`: delisted-only (same shape as this endpoint plus is_delisted=1 and last_seen_at). `all`: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted.
|
|
109
188
|
sort: 'downloads', # String | Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names.
|
|
110
189
|
limit: 56, # Integer | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
111
190
|
offset: 56 # Integer | Rows to skip. Negative and non-numeric values are treated as 0.
|
|
@@ -150,6 +229,7 @@ end
|
|
|
150
229
|
| **downloads_lte** | **Integer** | | [optional] |
|
|
151
230
|
| **created_after** | **String** | ISO-8601 date or timestamp, inclusive. | [optional] |
|
|
152
231
|
| **created_before** | **String** | ISO-8601 date or timestamp, inclusive. | [optional] |
|
|
232
|
+
| **delisted** | **String** | Tombstone filter. `live` (default): HF-visible models only. `dead`: delisted-only (same shape as this endpoint plus is_delisted=1 and last_seen_at). `all`: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted. | [optional][default to 'live'] |
|
|
153
233
|
| **sort** | **String** | Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names. | [optional][default to 'downloads'] |
|
|
154
234
|
| **limit** | **Integer** | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. | [optional][default to 50] |
|
|
155
235
|
| **offset** | **Integer** | Rows to skip. Negative and non-numeric values are treated as 0. | [optional][default to 0] |
|
|
@@ -20,7 +20,7 @@ module Abliteration
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Get one model
|
|
23
|
-
# Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded.
|
|
23
|
+
# Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries `is_delisted=1` and `days_since_gone`.
|
|
24
24
|
# @param id [String]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [GetModel200Response]
|
|
@@ -30,7 +30,7 @@ module Abliteration
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Get one model
|
|
33
|
-
# Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded.
|
|
33
|
+
# Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries `is_delisted=1` and `days_since_gone`.
|
|
34
34
|
# @param id [String]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(GetModel200Response, Integer, Hash)>] GetModel200Response data, response status code and response headers
|
|
@@ -82,8 +82,93 @@ module Abliteration
|
|
|
82
82
|
return data, status_code, headers
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
+
# List delisted models (change stream)
|
|
86
|
+
# Cost: 5 credits, flat. Change-stream companion to /models: every row is a tombstone — a model that HF no longer serves, preserved here at its final state. Poll with `since=<last_seen_at of your previous run>` to fetch only new casualties; callers building compliance dashboards, safety-research corpora, or \"wayback\" tools live on this endpoint. See /api#change-stream.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [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.
|
|
89
|
+
# @option opts [String] :sort `recent` (default, newest disappearance first) or `downloads` (biggest casualties first — best for post-mortem coverage). (default to 'recent')
|
|
90
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
91
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
92
|
+
# @return [ListDelistedModels200Response]
|
|
93
|
+
def list_delisted_models(opts = {})
|
|
94
|
+
data, _status_code, _headers = list_delisted_models_with_http_info(opts)
|
|
95
|
+
data
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List delisted models (change stream)
|
|
99
|
+
# Cost: 5 credits, flat. Change-stream companion to /models: every row is a tombstone — a model that HF no longer serves, preserved here at its final state. Poll with `since=<last_seen_at of your previous run>` to fetch only new casualties; callers building compliance dashboards, safety-research corpora, or \"wayback\" tools live on this endpoint. See /api#change-stream.
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @option opts [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.
|
|
102
|
+
# @option opts [String] :sort `recent` (default, newest disappearance first) or `downloads` (biggest casualties first — best for post-mortem coverage). (default to 'recent')
|
|
103
|
+
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
104
|
+
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
105
|
+
# @return [Array<(ListDelistedModels200Response, Integer, Hash)>] ListDelistedModels200Response data, response status code and response headers
|
|
106
|
+
def list_delisted_models_with_http_info(opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug 'Calling API: ModelsApi.list_delisted_models ...'
|
|
109
|
+
end
|
|
110
|
+
allowable_values = ["recent", "downloads"]
|
|
111
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
112
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
113
|
+
end
|
|
114
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
|
|
115
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_delisted_models, must be smaller than or equal to 1000.'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
119
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_delisted_models, must be greater than or equal to 1.'
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
123
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_delisted_models, must be greater than or equal to 0.'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# resource path
|
|
127
|
+
local_var_path = '/api/v1/models/delisted'
|
|
128
|
+
|
|
129
|
+
# query parameters
|
|
130
|
+
query_params = opts[:query_params] || {}
|
|
131
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
|
132
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
133
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
134
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
135
|
+
|
|
136
|
+
# header parameters
|
|
137
|
+
header_params = opts[:header_params] || {}
|
|
138
|
+
# HTTP header 'Accept' (if needed)
|
|
139
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body]
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type] || 'ListDelistedModels200Response'
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"ModelsApi.list_delisted_models",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: ModelsApi#list_delisted_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
85
170
|
# List models
|
|
86
|
-
# Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded
|
|
171
|
+
# Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (`delisted=live`); pass `delisted=dead|all` to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.
|
|
87
172
|
# @param [Hash] opts the optional parameters
|
|
88
173
|
# @option opts [String] :method M-code, case-insensitive. See GET /api/v1/methods.
|
|
89
174
|
# @option opts [String] :family Base family, for example qwen or llama.
|
|
@@ -93,6 +178,7 @@ module Abliteration
|
|
|
93
178
|
# @option opts [Integer] :downloads_lte
|
|
94
179
|
# @option opts [String] :created_after ISO-8601 date or timestamp, inclusive.
|
|
95
180
|
# @option opts [String] :created_before ISO-8601 date or timestamp, inclusive.
|
|
181
|
+
# @option opts [String] :delisted Tombstone filter. `live` (default): HF-visible models only. `dead`: delisted-only (same shape as this endpoint plus is_delisted=1 and last_seen_at). `all`: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted. (default to 'live')
|
|
96
182
|
# @option opts [String] :sort Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names. (default to 'downloads')
|
|
97
183
|
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
98
184
|
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
@@ -103,7 +189,7 @@ module Abliteration
|
|
|
103
189
|
end
|
|
104
190
|
|
|
105
191
|
# List models
|
|
106
|
-
# Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded
|
|
192
|
+
# Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (`delisted=live`); pass `delisted=dead|all` to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.
|
|
107
193
|
# @param [Hash] opts the optional parameters
|
|
108
194
|
# @option opts [String] :method M-code, case-insensitive. See GET /api/v1/methods.
|
|
109
195
|
# @option opts [String] :family Base family, for example qwen or llama.
|
|
@@ -113,6 +199,7 @@ module Abliteration
|
|
|
113
199
|
# @option opts [Integer] :downloads_lte
|
|
114
200
|
# @option opts [String] :created_after ISO-8601 date or timestamp, inclusive.
|
|
115
201
|
# @option opts [String] :created_before ISO-8601 date or timestamp, inclusive.
|
|
202
|
+
# @option opts [String] :delisted Tombstone filter. `live` (default): HF-visible models only. `dead`: delisted-only (same shape as this endpoint plus is_delisted=1 and last_seen_at). `all`: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted. (default to 'live')
|
|
116
203
|
# @option opts [String] :sort Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names. (default to 'downloads')
|
|
117
204
|
# @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
|
|
118
205
|
# @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
|
|
@@ -121,6 +208,10 @@ module Abliteration
|
|
|
121
208
|
if @api_client.config.debugging
|
|
122
209
|
@api_client.config.logger.debug 'Calling API: ModelsApi.list_models ...'
|
|
123
210
|
end
|
|
211
|
+
allowable_values = ["live", "dead", "all"]
|
|
212
|
+
if @api_client.config.client_side_validation && opts[:'delisted'] && !allowable_values.include?(opts[:'delisted'])
|
|
213
|
+
fail ArgumentError, "invalid value for \"delisted\", must be one of #{allowable_values}"
|
|
214
|
+
end
|
|
124
215
|
allowable_values = ["downloads", "-downloads", "likes", "-likes", "created", "-created", "created_at", "-created_at", "first_seen", "-first_seen", "first_seen_at", "-first_seen_at"]
|
|
125
216
|
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
126
217
|
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
@@ -150,6 +241,7 @@ module Abliteration
|
|
|
150
241
|
query_params[:'downloads_lte'] = opts[:'downloads_lte'] if !opts[:'downloads_lte'].nil?
|
|
151
242
|
query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
|
|
152
243
|
query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
|
|
244
|
+
query_params[:'delisted'] = opts[:'delisted'] if !opts[:'delisted'].nil?
|
|
153
245
|
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
154
246
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
155
247
|
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#abliteration.org Public API
|
|
3
|
+
|
|
4
|
+
#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.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Abliteration
|
|
17
|
+
class DelistedModel < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :author
|
|
21
|
+
|
|
22
|
+
attr_accessor :family
|
|
23
|
+
|
|
24
|
+
attr_accessor :params_b
|
|
25
|
+
|
|
26
|
+
# Downloads at the moment the model was last visible on HF. Not a live counter.
|
|
27
|
+
attr_accessor :downloads
|
|
28
|
+
|
|
29
|
+
# ISO-8601 timestamp of the last successful Hub observation. Approximately when the model died.
|
|
30
|
+
attr_accessor :last_seen_at
|
|
31
|
+
|
|
32
|
+
# Whole days between last_seen_at and now, computed server-side for convenience.
|
|
33
|
+
attr_accessor :days_since_gone
|
|
34
|
+
|
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
36
|
+
def self.attribute_map
|
|
37
|
+
{
|
|
38
|
+
:'id' => :'id',
|
|
39
|
+
:'author' => :'author',
|
|
40
|
+
:'family' => :'family',
|
|
41
|
+
:'params_b' => :'params_b',
|
|
42
|
+
:'downloads' => :'downloads',
|
|
43
|
+
:'last_seen_at' => :'last_seen_at',
|
|
44
|
+
:'days_since_gone' => :'days_since_gone'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'id' => :'String',
|
|
62
|
+
:'author' => :'String',
|
|
63
|
+
:'family' => :'String',
|
|
64
|
+
:'params_b' => :'Float',
|
|
65
|
+
:'downloads' => :'Integer',
|
|
66
|
+
:'last_seen_at' => :'String',
|
|
67
|
+
:'days_since_gone' => :'Integer'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# List of attributes with nullable: true
|
|
72
|
+
def self.openapi_nullable
|
|
73
|
+
Set.new([
|
|
74
|
+
:'family',
|
|
75
|
+
:'params_b',
|
|
76
|
+
])
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Initializes the object
|
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
|
+
def initialize(attributes = {})
|
|
82
|
+
if (!attributes.is_a?(Hash))
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DelistedModel` initialize method"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
87
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
89
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DelistedModel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
91
|
+
end
|
|
92
|
+
h[k.to_sym] = v
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'id')
|
|
96
|
+
self.id = attributes[:'id']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'author')
|
|
100
|
+
self.author = attributes[:'author']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'family')
|
|
104
|
+
self.family = attributes[:'family']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'params_b')
|
|
108
|
+
self.params_b = attributes[:'params_b']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'downloads')
|
|
112
|
+
self.downloads = attributes[:'downloads']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'last_seen_at')
|
|
116
|
+
self.last_seen_at = attributes[:'last_seen_at']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'days_since_gone')
|
|
120
|
+
self.days_since_gone = attributes[:'days_since_gone']
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
125
|
+
# @return Array for valid properties with the reasons
|
|
126
|
+
def list_invalid_properties
|
|
127
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
128
|
+
invalid_properties = Array.new
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Checks equality by comparing each attribute.
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def ==(o)
|
|
142
|
+
return true if self.equal?(o)
|
|
143
|
+
self.class == o.class &&
|
|
144
|
+
id == o.id &&
|
|
145
|
+
author == o.author &&
|
|
146
|
+
family == o.family &&
|
|
147
|
+
params_b == o.params_b &&
|
|
148
|
+
downloads == o.downloads &&
|
|
149
|
+
last_seen_at == o.last_seen_at &&
|
|
150
|
+
days_since_gone == o.days_since_gone
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# @see the `==` method
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def eql?(o)
|
|
156
|
+
self == o
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Calculates hash code according to all attributes.
|
|
160
|
+
# @return [Integer] Hash code
|
|
161
|
+
def hash
|
|
162
|
+
[id, author, family, params_b, downloads, last_seen_at, days_since_gone].hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Builds the object from hash
|
|
166
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
167
|
+
# @return [Object] Returns the model itself
|
|
168
|
+
def self.build_from_hash(attributes)
|
|
169
|
+
return nil unless attributes.is_a?(Hash)
|
|
170
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
171
|
+
transformed_hash = {}
|
|
172
|
+
openapi_types.each_pair do |key, type|
|
|
173
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
174
|
+
transformed_hash["#{key}"] = nil
|
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
176
|
+
# check to ensure the input is an array given that the attribute
|
|
177
|
+
# is documented as an array but the input is not
|
|
178
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
179
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
180
|
+
end
|
|
181
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
182
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
new(transformed_hash)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Returns the object in the form of hash
|
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
|
190
|
+
def to_hash
|
|
191
|
+
hash = {}
|
|
192
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
193
|
+
value = self.send(attr)
|
|
194
|
+
if value.nil?
|
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
hash[param] = _to_hash(value)
|
|
200
|
+
end
|
|
201
|
+
hash
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|