localpi 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/src/localpi/options.js +4 -0
- package/dist/src/pi/app.js +1 -1
- package/docs/runtime-specification.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -524,6 +524,7 @@ demowall record --session demowall-<timestamp> --out demo.mp4 --seconds 60
|
|
|
524
524
|
- `--max-tokens <n>`: generated model max output tokens
|
|
525
525
|
- `--continue-on-truncation <n>`: continue a reply cut off by the output limit, up to `n` times. Off by default, and `LOCALPI_CONTINUE_ON_TRUNCATION=<n>` sets the same limit
|
|
526
526
|
- `--base-url <url>`: OpenAI-compatible endpoint for LM Studio or custom endpoints
|
|
527
|
+
- `--api-key <value>`: Pi provider API key for this run. A literal value, an environment reference such as `${NAME}`, or a `!command`. Default: `local`. `LOCALPI_API_KEY` sets the same value
|
|
527
528
|
- `--server-command <path>`: `llama-server` executable path
|
|
528
529
|
- `--llama-server <path>`: alias for `--server-command`
|
|
529
530
|
- `--host <host>`: managed `llama-server` host. Default: `127.0.0.1`
|
|
@@ -583,6 +584,7 @@ explicit `PI_OFFLINE=0` or `PI_OFFLINE=1` always wins.
|
|
|
583
584
|
- `LOCALPI_MODEL`
|
|
584
585
|
- `LOCALPI_PROVIDER`
|
|
585
586
|
- `LOCALPI_BASE_URL`
|
|
587
|
+
- `LOCALPI_API_KEY`
|
|
586
588
|
- `LOCALPI_PROVIDERS_FILE`
|
|
587
589
|
- `LOCALPI_MODEL_PROFILE`
|
|
588
590
|
- `LOCALPI_MODEL_REASONING`
|
|
@@ -19,6 +19,7 @@ export function defaultOptions() {
|
|
|
19
19
|
return {
|
|
20
20
|
runtime: parseRuntime(envString("LOCALPI_RUNTIME", "auto")),
|
|
21
21
|
baseUrl: envOptionalBaseUrl("LOCALPI_BASE_URL"),
|
|
22
|
+
apiKey: envString("LOCALPI_API_KEY", "local"),
|
|
22
23
|
model: process.env["LOCALPI_MODEL"],
|
|
23
24
|
provider: process.env["LOCALPI_PROVIDER"],
|
|
24
25
|
customProviderId: envString("LOCALPI_PROVIDER_ID", "local-openai"),
|
|
@@ -100,6 +101,8 @@ export function usage() {
|
|
|
100
101
|
" --provider <id> catalog provider id to use",
|
|
101
102
|
" --model <alias|id|path> model alias, backend id, or GGUF path",
|
|
102
103
|
" --base-url <url> OpenAI-compatible endpoint",
|
|
104
|
+
" --api-key <value> Pi provider API key: a literal, ${NAME}, or !command",
|
|
105
|
+
" (LOCALPI_API_KEY=<value>, default: local)",
|
|
103
106
|
" --ctx <n> model context window",
|
|
104
107
|
" --context-window <n> alias for --ctx",
|
|
105
108
|
" --max-tokens <n> generated model max output tokens",
|
|
@@ -189,6 +192,7 @@ const booleanFlagUpdaters = {
|
|
|
189
192
|
const valueFlagUpdaters = {
|
|
190
193
|
"--runtime": (options, value) => ({ ...options, runtime: parseRuntime(value) }),
|
|
191
194
|
"--base-url": (options, value) => ({ ...options, baseUrl: normalizeBaseUrl(value) }),
|
|
195
|
+
"--api-key": (options, value) => ({ ...options, apiKey: value }),
|
|
192
196
|
"--model": (options, value) => ({ ...options, model: value }),
|
|
193
197
|
"--provider": (options, value) => ({ ...options, provider: value }),
|
|
194
198
|
"--provider-id": (options, value) => ({ ...options, customProviderId: value }),
|
package/dist/src/pi/app.js
CHANGED
|
@@ -86,7 +86,7 @@ function providersForConnection(options, connection) {
|
|
|
86
86
|
id: group.providerId,
|
|
87
87
|
baseUrl: group.baseUrl,
|
|
88
88
|
api: "openai-completions",
|
|
89
|
-
apiKey:
|
|
89
|
+
apiKey: options.apiKey,
|
|
90
90
|
compat: {
|
|
91
91
|
supportsDeveloperRole: false,
|
|
92
92
|
supportsReasoningEffort: false
|
|
@@ -110,6 +110,7 @@ Localpi:
|
|
|
110
110
|
- can use `--provider <id>` to name the generated Pi provider
|
|
111
111
|
- uses `/v1/models` for discovery
|
|
112
112
|
- avoids assuming it can start, stop, or unload the backend
|
|
113
|
+
- writes the `--api-key` value as the generated Pi provider key, exactly as given, so an environment reference such as `${HF_TOKEN}` or a `!command` keeps the secret out of the Pi config. The default is `local`, which local engines accept and ignore
|
|
113
114
|
|
|
114
115
|
### Configured Providers
|
|
115
116
|
|