@foldrun/core 13.0.0 → 13.1.1
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/dist/src/model-supply.d.ts +0 -3
- package/dist/src/model-supply.js +3 -6
- package/dist/src/starter.js +3 -1
- package/package.json +1 -1
- package/src/model-supply.ts +3 -9
- package/src/starter.ts +3 -1
|
@@ -7,9 +7,6 @@ export interface SupplyProvider {
|
|
|
7
7
|
format: WireFormat;
|
|
8
8
|
/** The one host the key is granted to. */
|
|
9
9
|
host: string;
|
|
10
|
-
/** Where the platform's key lives, in the worker's and the proxy's
|
|
11
|
-
* environment. Never in the vault, never in a lease. */
|
|
12
|
-
env: string;
|
|
13
10
|
/** The header the key may be filled in, and its exact shape: the whole
|
|
14
11
|
* value of x-api-key, or "Bearer <key>" in authorization. Anywhere else —
|
|
15
12
|
* the URL, the body, another header — is refused. */
|
package/dist/src/model-supply.js
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
// that grant only in the provider's auth header, on the provider's model
|
|
10
10
|
// routes, and meters every call — the bill comes from the gateway.
|
|
11
11
|
//
|
|
12
|
-
// A provider here is offered only where the platform holds its key
|
|
13
|
-
//
|
|
12
|
+
// A provider here is offered only where the platform holds its key (set by
|
|
13
|
+
// an operator in the console, sealed in the platform's store — never in the
|
|
14
|
+
// environment), the operator lists it, and the price list names the model.
|
|
14
15
|
import { providerPreset } from "./providers.js";
|
|
15
16
|
export const SUPPLY_PROVIDERS = {
|
|
16
17
|
anthropic: {
|
|
@@ -18,7 +19,6 @@ export const SUPPLY_PROVIDERS = {
|
|
|
18
19
|
preset: "anthropic",
|
|
19
20
|
format: "anthropic",
|
|
20
21
|
host: "api.anthropic.com",
|
|
21
|
-
env: "FOLDRUN_SUPPLY_ANTHROPIC_API_KEY",
|
|
22
22
|
auth: "x-api-key",
|
|
23
23
|
metered: ["/v1/messages"],
|
|
24
24
|
free: [
|
|
@@ -31,7 +31,6 @@ export const SUPPLY_PROVIDERS = {
|
|
|
31
31
|
preset: "openrouter",
|
|
32
32
|
format: "anthropic",
|
|
33
33
|
host: "openrouter.ai",
|
|
34
|
-
env: "FOLDRUN_SUPPLY_OPENROUTER_API_KEY",
|
|
35
34
|
auth: "bearer",
|
|
36
35
|
metered: ["/api/v1/messages"],
|
|
37
36
|
free: [{ method: "GET", path: "/api/v1/models" }],
|
|
@@ -41,7 +40,6 @@ export const SUPPLY_PROVIDERS = {
|
|
|
41
40
|
preset: "openai",
|
|
42
41
|
format: "openai",
|
|
43
42
|
host: "api.openai.com",
|
|
44
|
-
env: "FOLDRUN_SUPPLY_OPENAI_API_KEY",
|
|
45
43
|
auth: "bearer",
|
|
46
44
|
metered: ["/v1/chat/completions"],
|
|
47
45
|
free: [{ method: "GET", path: "/v1/models" }],
|
|
@@ -51,7 +49,6 @@ export const SUPPLY_PROVIDERS = {
|
|
|
51
49
|
preset: "gemini",
|
|
52
50
|
format: "openai",
|
|
53
51
|
host: "generativelanguage.googleapis.com",
|
|
54
|
-
env: "FOLDRUN_SUPPLY_GEMINI_API_KEY",
|
|
55
52
|
auth: "bearer",
|
|
56
53
|
metered: ["/v1beta/openai/chat/completions"],
|
|
57
54
|
free: [{ method: "GET", path: "/v1beta/openai/models" }],
|
package/dist/src/starter.js
CHANGED
|
@@ -42,7 +42,9 @@ foldrun_version: "0.1"
|
|
|
42
42
|
#
|
|
43
43
|
# Your own model key needs no block: Settings → Model provider, or
|
|
44
44
|
# \`foldrun account model set anthropic --key …\` (an API key, not a login).
|
|
45
|
-
#
|
|
45
|
+
# On foldrun's own platform you can run on foldrun's models instead, billed
|
|
46
|
+
# in credits: \`foldrun account model use foldrun --provider anthropic\`.
|
|
47
|
+
# A provider: block here or lower wins over either.
|
|
46
48
|
#
|
|
47
49
|
# provider:
|
|
48
50
|
# base_url: https://openrouter.ai/api
|
package/package.json
CHANGED
package/src/model-supply.ts
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
// that grant only in the provider's auth header, on the provider's model
|
|
10
10
|
// routes, and meters every call — the bill comes from the gateway.
|
|
11
11
|
//
|
|
12
|
-
// A provider here is offered only where the platform holds its key
|
|
13
|
-
//
|
|
12
|
+
// A provider here is offered only where the platform holds its key (set by
|
|
13
|
+
// an operator in the console, sealed in the platform's store — never in the
|
|
14
|
+
// environment), the operator lists it, and the price list names the model.
|
|
14
15
|
|
|
15
16
|
import { providerPreset, type WireFormat } from "./providers.ts";
|
|
16
17
|
|
|
@@ -23,9 +24,6 @@ export interface SupplyProvider {
|
|
|
23
24
|
format: WireFormat;
|
|
24
25
|
/** The one host the key is granted to. */
|
|
25
26
|
host: string;
|
|
26
|
-
/** Where the platform's key lives, in the worker's and the proxy's
|
|
27
|
-
* environment. Never in the vault, never in a lease. */
|
|
28
|
-
env: string;
|
|
29
27
|
/** The header the key may be filled in, and its exact shape: the whole
|
|
30
28
|
* value of x-api-key, or "Bearer <key>" in authorization. Anywhere else —
|
|
31
29
|
* the URL, the body, another header — is refused. */
|
|
@@ -43,7 +41,6 @@ export const SUPPLY_PROVIDERS: Record<SupplyProviderName, SupplyProvider> = {
|
|
|
43
41
|
preset: "anthropic",
|
|
44
42
|
format: "anthropic",
|
|
45
43
|
host: "api.anthropic.com",
|
|
46
|
-
env: "FOLDRUN_SUPPLY_ANTHROPIC_API_KEY",
|
|
47
44
|
auth: "x-api-key",
|
|
48
45
|
metered: ["/v1/messages"],
|
|
49
46
|
free: [
|
|
@@ -56,7 +53,6 @@ export const SUPPLY_PROVIDERS: Record<SupplyProviderName, SupplyProvider> = {
|
|
|
56
53
|
preset: "openrouter",
|
|
57
54
|
format: "anthropic",
|
|
58
55
|
host: "openrouter.ai",
|
|
59
|
-
env: "FOLDRUN_SUPPLY_OPENROUTER_API_KEY",
|
|
60
56
|
auth: "bearer",
|
|
61
57
|
metered: ["/api/v1/messages"],
|
|
62
58
|
free: [{ method: "GET", path: "/api/v1/models" }],
|
|
@@ -66,7 +62,6 @@ export const SUPPLY_PROVIDERS: Record<SupplyProviderName, SupplyProvider> = {
|
|
|
66
62
|
preset: "openai",
|
|
67
63
|
format: "openai",
|
|
68
64
|
host: "api.openai.com",
|
|
69
|
-
env: "FOLDRUN_SUPPLY_OPENAI_API_KEY",
|
|
70
65
|
auth: "bearer",
|
|
71
66
|
metered: ["/v1/chat/completions"],
|
|
72
67
|
free: [{ method: "GET", path: "/v1/models" }],
|
|
@@ -76,7 +71,6 @@ export const SUPPLY_PROVIDERS: Record<SupplyProviderName, SupplyProvider> = {
|
|
|
76
71
|
preset: "gemini",
|
|
77
72
|
format: "openai",
|
|
78
73
|
host: "generativelanguage.googleapis.com",
|
|
79
|
-
env: "FOLDRUN_SUPPLY_GEMINI_API_KEY",
|
|
80
74
|
auth: "bearer",
|
|
81
75
|
metered: ["/v1beta/openai/chat/completions"],
|
|
82
76
|
free: [{ method: "GET", path: "/v1beta/openai/models" }],
|
package/src/starter.ts
CHANGED
|
@@ -49,7 +49,9 @@ foldrun_version: "0.1"
|
|
|
49
49
|
#
|
|
50
50
|
# Your own model key needs no block: Settings → Model provider, or
|
|
51
51
|
# \`foldrun account model set anthropic --key …\` (an API key, not a login).
|
|
52
|
-
#
|
|
52
|
+
# On foldrun's own platform you can run on foldrun's models instead, billed
|
|
53
|
+
# in credits: \`foldrun account model use foldrun --provider anthropic\`.
|
|
54
|
+
# A provider: block here or lower wins over either.
|
|
53
55
|
#
|
|
54
56
|
# provider:
|
|
55
57
|
# base_url: https://openrouter.ai/api
|