create-ragen-app 0.4.0 → 0.6.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 +39 -31
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +206 -41
- package/dist/cli.js.map +1 -1
- package/dist/config-template.js +3 -3
- package/dist/llm-provider.d.ts +32 -10
- package/dist/llm-provider.d.ts.map +1 -1
- package/dist/llm-provider.js +52 -29
- package/dist/llm-provider.js.map +1 -1
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +0 -34
- package/dist/manifest.js.map +1 -1
- package/dist/manual-setup.d.ts.map +1 -1
- package/dist/manual-setup.js +16 -24
- package/dist/manual-setup.js.map +1 -1
- package/dist/pii-masking.d.ts +26 -0
- package/dist/pii-masking.d.ts.map +1 -0
- package/dist/pii-masking.js +36 -0
- package/dist/pii-masking.js.map +1 -0
- package/dist/route-table.d.ts +12 -4
- package/dist/route-table.d.ts.map +1 -1
- package/dist/route-table.js +6 -6
- package/dist/route-table.js.map +1 -1
- package/dist/tasks.d.ts +10 -1
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js +13 -2
- package/dist/tasks.js.map +1 -1
- package/dist/worker-runtime.d.ts +101 -0
- package/dist/worker-runtime.d.ts.map +1 -0
- package/dist/worker-runtime.js +118 -0
- package/dist/worker-runtime.js.map +1 -0
- package/package.json +3 -3
- package/dist/litellm-config.d.ts +0 -17
- package/dist/litellm-config.d.ts.map +0 -1
- package/dist/litellm-config.js +0 -28
- package/dist/litellm-config.js.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which engine runs background jobs, and what choosing BullMQ configures.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `WORKER_RUNTIME_SEAM` in `@ragenai/env`. Copied rather than imported
|
|
5
|
+
* for the reason `storage-provider.ts` gives: this package is published to npm
|
|
6
|
+
* and `@ragenai/env` is private, so depending on it would make
|
|
7
|
+
* `npm create ragen-app` unresolvable.
|
|
8
|
+
*/
|
|
9
|
+
export type WorkerRuntimeChoice = 'temporal' | 'bullmq';
|
|
10
|
+
export declare const WORKER_RUNTIME_LABELS: Record<WorkerRuntimeChoice, string>;
|
|
11
|
+
/**
|
|
12
|
+
* The published Redis port, not the standard one.
|
|
13
|
+
*
|
|
14
|
+
* `docker-compose.yml` maps Redis to 56379 for the reason Postgres is on
|
|
15
|
+
* 55432: a native Redis on 6379 answers instead of the container, and nothing
|
|
16
|
+
* about the resulting failure names a port.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DEFAULT_REDIS_URL = "redis://localhost:56379";
|
|
19
|
+
/**
|
|
20
|
+
* What the address prompt starts from — the adapter's own fallback, and what
|
|
21
|
+
* `.env.example` ships.
|
|
22
|
+
*
|
|
23
|
+
* Offered as a prefilled answer rather than written silently: right on a
|
|
24
|
+
* laptop, wrong everywhere else, and a deployed worker pointing at its own
|
|
25
|
+
* container connects to nothing and processes nothing with no error to read.
|
|
26
|
+
* Temporal left the compose file with ADR-44, so this address now names a
|
|
27
|
+
* server the operator runs — which makes it exactly the value they should see
|
|
28
|
+
* before it is written.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DEFAULT_TEMPORAL_SERVER_ADDRESS = "localhost:7233";
|
|
31
|
+
/**
|
|
32
|
+
* A password the operator never has to invent, and that is never the same
|
|
33
|
+
* twice.
|
|
34
|
+
*
|
|
35
|
+
* The dashboard is off unless both credentials are set, so an installer that
|
|
36
|
+
* left them blank would ship the runtime with no way to see the queues — which
|
|
37
|
+
* is the thing the Temporal UI used to provide for free. Writing them is the
|
|
38
|
+
* point.
|
|
39
|
+
*
|
|
40
|
+
* **Generated rather than a fixed default.** A password shipped in this
|
|
41
|
+
* repository is the same password on every install, on a port that exposes
|
|
42
|
+
* every job's payload; the first person to read the source has it everywhere.
|
|
43
|
+
* Generating costs the operator nothing — they type nothing either way — and
|
|
44
|
+
* the value is printed once so it can be put in a password manager.
|
|
45
|
+
*
|
|
46
|
+
* Short enough to retype by hand, unlike `generateSecret()`'s 64 hex
|
|
47
|
+
* characters: this one is read off a terminal and typed into a browser prompt.
|
|
48
|
+
*/
|
|
49
|
+
export declare function generateAdminPassword(): string;
|
|
50
|
+
export declare const DEFAULT_ADMIN_USER = "admin";
|
|
51
|
+
/**
|
|
52
|
+
* How many documents the worker ingests at once, written explicitly rather
|
|
53
|
+
* than left to the code's default.
|
|
54
|
+
*
|
|
55
|
+
* It matches `DEFAULT_CONCURRENCY` in `@ragenai/jobs-bullmq`, which D2 raised
|
|
56
|
+
* from 10 to 20 on the strength of the same measurement: twenty documents
|
|
57
|
+
* uploaded at once took a median of 24.9s each at 10 and 12.3s at 20, the
|
|
58
|
+
* difference sitting entirely before parsing began rather than in the work.
|
|
59
|
+
*
|
|
60
|
+
* **Written anyway, even though it now equals the default.** The number the
|
|
61
|
+
* operator has to revisit is this one — it is the first thing to lower when a
|
|
62
|
+
* provider starts rate-limiting — and a default they never see is not a knob
|
|
63
|
+
* they can find. If the two ever diverge, this line is the install's answer and
|
|
64
|
+
* the code's is the fallback for everyone else.
|
|
65
|
+
*
|
|
66
|
+
* **A constant, not a guess from the machine.** `os.cpus().length` is the
|
|
67
|
+
* tempting input and it measures the wrong thing: an ingest is almost entirely
|
|
68
|
+
* waiting — on storage, on the parser, on the embedding provider — so cores
|
|
69
|
+
* predict nothing about how many can be in flight. A number derived from
|
|
70
|
+
* hardware would look principled and mean less than this one.
|
|
71
|
+
*
|
|
72
|
+
* Written into `.env` rather than applied silently, because the ceiling that
|
|
73
|
+
* really binds is the model provider's rate limit, and the operator is the
|
|
74
|
+
* only one who knows it. A value they can see is a value they can raise.
|
|
75
|
+
*/
|
|
76
|
+
export declare const DEFAULT_WORKER_CONCURRENCY = "20";
|
|
77
|
+
export interface WorkerRuntimeAnswers {
|
|
78
|
+
/** Blank takes `DEFAULT_TEMPORAL_SERVER_ADDRESS`. */
|
|
79
|
+
temporalServerAddress: string;
|
|
80
|
+
}
|
|
81
|
+
export interface WorkerRuntimeSelection {
|
|
82
|
+
choice: WorkerRuntimeChoice;
|
|
83
|
+
envUpdates: Record<string, string>;
|
|
84
|
+
/** Shown once after the install, when there is something to show. */
|
|
85
|
+
dashboard?: {
|
|
86
|
+
user: string;
|
|
87
|
+
password: string;
|
|
88
|
+
port: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* **The runtime each variant cannot work without is written here**, not left to
|
|
93
|
+
* whatever `.env.example` happens to ship. `REDIS_URL` is required under
|
|
94
|
+
* BullMQ and `TEMPORAL_SERVER_ADDRESS` under Temporal, and since #1224 the
|
|
95
|
+
* producers refuse to boot without the one their runtime names — so a wizard
|
|
96
|
+
* that picks the runtime and not its address configures an install that stops
|
|
97
|
+
* at startup. `create-ragen-app-knows-the-provider-seams.test.ts` holds this to
|
|
98
|
+
* the seam.
|
|
99
|
+
*/
|
|
100
|
+
export declare function resolveWorkerRuntimeSelection(choice: WorkerRuntimeChoice, answers?: WorkerRuntimeAnswers): WorkerRuntimeSelection;
|
|
101
|
+
//# sourceMappingURL=worker-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-runtime.d.ts","sourceRoot":"","sources":["../src/worker-runtime.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAExD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAIrE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,mBAAmB,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,qEAAqE;IACrE,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,sBAAsB,CAgCxB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_WORKER_CONCURRENCY = exports.DEFAULT_ADMIN_USER = exports.DEFAULT_TEMPORAL_SERVER_ADDRESS = exports.DEFAULT_REDIS_URL = exports.WORKER_RUNTIME_LABELS = void 0;
|
|
4
|
+
exports.generateAdminPassword = generateAdminPassword;
|
|
5
|
+
exports.resolveWorkerRuntimeSelection = resolveWorkerRuntimeSelection;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
|
+
exports.WORKER_RUNTIME_LABELS = {
|
|
8
|
+
bullmq: 'BullMQ — the default. Runs on the Redis this install already has.',
|
|
9
|
+
temporal: 'Temporal — durable execution, on a server you run yourself (ADR-44).',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The published Redis port, not the standard one.
|
|
13
|
+
*
|
|
14
|
+
* `docker-compose.yml` maps Redis to 56379 for the reason Postgres is on
|
|
15
|
+
* 55432: a native Redis on 6379 answers instead of the container, and nothing
|
|
16
|
+
* about the resulting failure names a port.
|
|
17
|
+
*/
|
|
18
|
+
exports.DEFAULT_REDIS_URL = 'redis://localhost:56379';
|
|
19
|
+
/**
|
|
20
|
+
* What the address prompt starts from — the adapter's own fallback, and what
|
|
21
|
+
* `.env.example` ships.
|
|
22
|
+
*
|
|
23
|
+
* Offered as a prefilled answer rather than written silently: right on a
|
|
24
|
+
* laptop, wrong everywhere else, and a deployed worker pointing at its own
|
|
25
|
+
* container connects to nothing and processes nothing with no error to read.
|
|
26
|
+
* Temporal left the compose file with ADR-44, so this address now names a
|
|
27
|
+
* server the operator runs — which makes it exactly the value they should see
|
|
28
|
+
* before it is written.
|
|
29
|
+
*/
|
|
30
|
+
exports.DEFAULT_TEMPORAL_SERVER_ADDRESS = 'localhost:7233';
|
|
31
|
+
/**
|
|
32
|
+
* A password the operator never has to invent, and that is never the same
|
|
33
|
+
* twice.
|
|
34
|
+
*
|
|
35
|
+
* The dashboard is off unless both credentials are set, so an installer that
|
|
36
|
+
* left them blank would ship the runtime with no way to see the queues — which
|
|
37
|
+
* is the thing the Temporal UI used to provide for free. Writing them is the
|
|
38
|
+
* point.
|
|
39
|
+
*
|
|
40
|
+
* **Generated rather than a fixed default.** A password shipped in this
|
|
41
|
+
* repository is the same password on every install, on a port that exposes
|
|
42
|
+
* every job's payload; the first person to read the source has it everywhere.
|
|
43
|
+
* Generating costs the operator nothing — they type nothing either way — and
|
|
44
|
+
* the value is printed once so it can be put in a password manager.
|
|
45
|
+
*
|
|
46
|
+
* Short enough to retype by hand, unlike `generateSecret()`'s 64 hex
|
|
47
|
+
* characters: this one is read off a terminal and typed into a browser prompt.
|
|
48
|
+
*/
|
|
49
|
+
function generateAdminPassword() {
|
|
50
|
+
return (0, node_crypto_1.randomBytes)(12).toString('base64url');
|
|
51
|
+
}
|
|
52
|
+
exports.DEFAULT_ADMIN_USER = 'admin';
|
|
53
|
+
/**
|
|
54
|
+
* How many documents the worker ingests at once, written explicitly rather
|
|
55
|
+
* than left to the code's default.
|
|
56
|
+
*
|
|
57
|
+
* It matches `DEFAULT_CONCURRENCY` in `@ragenai/jobs-bullmq`, which D2 raised
|
|
58
|
+
* from 10 to 20 on the strength of the same measurement: twenty documents
|
|
59
|
+
* uploaded at once took a median of 24.9s each at 10 and 12.3s at 20, the
|
|
60
|
+
* difference sitting entirely before parsing began rather than in the work.
|
|
61
|
+
*
|
|
62
|
+
* **Written anyway, even though it now equals the default.** The number the
|
|
63
|
+
* operator has to revisit is this one — it is the first thing to lower when a
|
|
64
|
+
* provider starts rate-limiting — and a default they never see is not a knob
|
|
65
|
+
* they can find. If the two ever diverge, this line is the install's answer and
|
|
66
|
+
* the code's is the fallback for everyone else.
|
|
67
|
+
*
|
|
68
|
+
* **A constant, not a guess from the machine.** `os.cpus().length` is the
|
|
69
|
+
* tempting input and it measures the wrong thing: an ingest is almost entirely
|
|
70
|
+
* waiting — on storage, on the parser, on the embedding provider — so cores
|
|
71
|
+
* predict nothing about how many can be in flight. A number derived from
|
|
72
|
+
* hardware would look principled and mean less than this one.
|
|
73
|
+
*
|
|
74
|
+
* Written into `.env` rather than applied silently, because the ceiling that
|
|
75
|
+
* really binds is the model provider's rate limit, and the operator is the
|
|
76
|
+
* only one who knows it. A value they can see is a value they can raise.
|
|
77
|
+
*/
|
|
78
|
+
exports.DEFAULT_WORKER_CONCURRENCY = '20';
|
|
79
|
+
/**
|
|
80
|
+
* **The runtime each variant cannot work without is written here**, not left to
|
|
81
|
+
* whatever `.env.example` happens to ship. `REDIS_URL` is required under
|
|
82
|
+
* BullMQ and `TEMPORAL_SERVER_ADDRESS` under Temporal, and since #1224 the
|
|
83
|
+
* producers refuse to boot without the one their runtime names — so a wizard
|
|
84
|
+
* that picks the runtime and not its address configures an install that stops
|
|
85
|
+
* at startup. `create-ragen-app-knows-the-provider-seams.test.ts` holds this to
|
|
86
|
+
* the seam.
|
|
87
|
+
*/
|
|
88
|
+
function resolveWorkerRuntimeSelection(choice, answers) {
|
|
89
|
+
// Only an explicit `temporal` leaves the default. The fallback used to point
|
|
90
|
+
// the other way, when Temporal was what the compose file ran; now an
|
|
91
|
+
// unexpected value — a future variant, a mistyped flag — lands on the runtime
|
|
92
|
+
// this install actually ships, rather than on one that is no longer there.
|
|
93
|
+
if (choice === 'temporal') {
|
|
94
|
+
return {
|
|
95
|
+
choice: 'temporal',
|
|
96
|
+
envUpdates: {
|
|
97
|
+
WORKER_RUNTIME: 'temporal',
|
|
98
|
+
TEMPORAL_SERVER_ADDRESS: answers?.temporalServerAddress.trim() ||
|
|
99
|
+
exports.DEFAULT_TEMPORAL_SERVER_ADDRESS,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const password = generateAdminPassword();
|
|
104
|
+
const port = '8090';
|
|
105
|
+
return {
|
|
106
|
+
choice: 'bullmq',
|
|
107
|
+
envUpdates: {
|
|
108
|
+
WORKER_RUNTIME: 'bullmq',
|
|
109
|
+
REDIS_URL: exports.DEFAULT_REDIS_URL,
|
|
110
|
+
WORKER_CONCURRENCY: exports.DEFAULT_WORKER_CONCURRENCY,
|
|
111
|
+
WORKER_ADMIN_USER: exports.DEFAULT_ADMIN_USER,
|
|
112
|
+
WORKER_ADMIN_PASSWORD: password,
|
|
113
|
+
WORKER_ADMIN_PORT: port,
|
|
114
|
+
},
|
|
115
|
+
dashboard: { user: exports.DEFAULT_ADMIN_USER, password, port },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=worker-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-runtime.js","sourceRoot":"","sources":["../src/worker-runtime.ts"],"names":[],"mappings":";;;AA2DA,sDAEC;AAoDD,sEAmCC;AApJD,6CAA0C;AAa7B,QAAA,qBAAqB,GAAwC;IACxE,MAAM,EAAE,mEAAmE;IAC3E,QAAQ,EACN,sEAAsE;CACzE,CAAC;AAEF;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG,yBAAyB,CAAC;AAE3D;;;;;;;;;;GAUG;AACU,QAAA,+BAA+B,GAAG,gBAAgB,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,qBAAqB;IACnC,OAAO,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC/C,CAAC;AAEY,QAAA,kBAAkB,GAAG,OAAO,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,0BAA0B,GAAG,IAAI,CAAC;AAc/C;;;;;;;;GAQG;AACH,SAAgB,6BAA6B,CAC3C,MAA2B,EAC3B,OAA8B;IAE9B,6EAA6E;IAC7E,qEAAqE;IACrE,8EAA8E;IAC9E,2EAA2E;IAC3E,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QAC1B,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE;gBACV,cAAc,EAAE,UAAU;gBAC1B,uBAAuB,EACrB,OAAO,EAAE,qBAAqB,CAAC,IAAI,EAAE;oBACrC,uCAA+B;aAClC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,qBAAqB,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,MAAM,CAAC;IAEpB,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE;YACV,cAAc,EAAE,QAAQ;YACxB,SAAS,EAAE,yBAAiB;YAC5B,kBAAkB,EAAE,kCAA0B;YAC9C,iBAAiB,EAAE,0BAAkB;YACrC,qBAAqB,EAAE,QAAQ;YAC/B,iBAAiB,EAAE,IAAI;SACxB;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,0BAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE;KACxD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ragen-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Scaffold a self-hosted Ragen AI installation with one command",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"bin": {
|
|
8
|
-
"create-ragen-app": "
|
|
8
|
+
"create-ragen-app": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/webamigos/RagenAI.git",
|
|
19
|
+
"url": "git+https://github.com/webamigos/RagenAI.git",
|
|
20
20
|
"directory": "packages/create-ragen-app"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
package/dist/litellm-config.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wires a plain OpenAI or Anthropic API key into `infra/litellm/config.yaml`
|
|
3
|
-
* by inserting a new `model_list` entry as text, not by parsing and
|
|
4
|
-
* re-serializing the YAML. The shipped config is heavily hand-commented
|
|
5
|
-
* (rationale for every model, dated notes, links) and a round-trip through a
|
|
6
|
-
* YAML library would collapse or reorder all of that — a text splice right
|
|
7
|
-
* after the `model_list:` key preserves everything else byte-for-byte.
|
|
8
|
-
*/
|
|
9
|
-
export interface LiteLLMModelEntry {
|
|
10
|
-
modelName: string;
|
|
11
|
-
/** LiteLLM provider-prefixed model id, e.g. "openai/gpt-4o-mini". */
|
|
12
|
-
model: string;
|
|
13
|
-
/** Name of the env var holding the API key, e.g. "OPENAI_API_KEY". */
|
|
14
|
-
apiKeyEnvVar: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function addLiteLLMModel(configText: string, entry: LiteLLMModelEntry): string;
|
|
17
|
-
//# sourceMappingURL=litellm-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"litellm-config.d.ts","sourceRoot":"","sources":["../src/litellm-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,iBAAiB,GACvB,MAAM,CAoBR"}
|
package/dist/litellm-config.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Wires a plain OpenAI or Anthropic API key into `infra/litellm/config.yaml`
|
|
4
|
-
* by inserting a new `model_list` entry as text, not by parsing and
|
|
5
|
-
* re-serializing the YAML. The shipped config is heavily hand-commented
|
|
6
|
-
* (rationale for every model, dated notes, links) and a round-trip through a
|
|
7
|
-
* YAML library would collapse or reorder all of that — a text splice right
|
|
8
|
-
* after the `model_list:` key preserves everything else byte-for-byte.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.addLiteLLMModel = addLiteLLMModel;
|
|
12
|
-
function addLiteLLMModel(configText, entry) {
|
|
13
|
-
const lines = configText.split('\n');
|
|
14
|
-
const anchorIndex = lines.findIndex((line) => line.trim() === 'model_list:');
|
|
15
|
-
if (anchorIndex === -1) {
|
|
16
|
-
throw new Error('infra/litellm/config.yaml has no `model_list:` key — cannot insert a model entry.');
|
|
17
|
-
}
|
|
18
|
-
const entryLines = [
|
|
19
|
-
` - model_name: ${entry.modelName}`,
|
|
20
|
-
' litellm_params:',
|
|
21
|
-
` model: ${entry.model}`,
|
|
22
|
-
` api_key: os.environ/${entry.apiKeyEnvVar}`,
|
|
23
|
-
'',
|
|
24
|
-
];
|
|
25
|
-
lines.splice(anchorIndex + 1, 0, ...entryLines);
|
|
26
|
-
return lines.join('\n');
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=litellm-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"litellm-config.js","sourceRoot":"","sources":["../src/litellm-config.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAUH,0CAuBC;AAvBD,SAAgB,eAAe,CAC7B,UAAkB,EAClB,KAAwB;IAExB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,aAAa,CAAC,CAAC;IAE7E,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG;QACjB,mBAAmB,KAAK,CAAC,SAAS,EAAE;QACpC,qBAAqB;QACrB,gBAAgB,KAAK,CAAC,KAAK,EAAE;QAC7B,6BAA6B,KAAK,CAAC,YAAY,EAAE;QACjD,EAAE;KACH,CAAC;IAEF,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;IAChD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|