pi-provider-litellm 4.5.0 → 4.7.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 +26 -10
- package/package.json +3 -3
- package/src/backend-identity.ts +1 -1
- package/src/budget.ts +70 -1
- package/src/discover.ts +23 -5
- package/src/index.ts +42 -12
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
LiteLLM proxy native Provider extension for [Pi](https://pi.dev). Pi 0.99.2+ is required; on older Pi, install `npm:pi-provider-litellm@3.4.0`.
|
|
4
4
|
|
|
5
|
-
Discovers models from self-hosted LiteLLM proxies and registers them under Pi providers. The default provider is `litellm`; optional aliases can register additional LiteLLM providers with separate credentials. Supports `/login litellm`, LiteLLM MCP tools, LiteLLM Skills Gateway prompt injection, and Google ADC token auth. Tries `/model/info` first (admin endpoint with rich metadata), falls back to `/v1/models` (OpenAI-compatible) on 401/403/404 or an empty list, then tries `/health` plus per-endpoint `/model/info` for older LiteLLM proxies.
|
|
5
|
+
Discovers models from self-hosted LiteLLM proxies and registers them under Pi providers. The default provider is `litellm`; optional aliases can register additional LiteLLM providers with separate credentials. Supports `/login litellm`, LiteLLM MCP tools, LiteLLM Skills Gateway prompt injection, budget status, image generation and classifier routes, and Google ADC token auth. A [Go port](#pig) brings it to PiG, without image generation and classifier routes. Tries `/model/info` first (admin endpoint with rich metadata), falls back to `/v1/models` (OpenAI-compatible) on 401/403/404 or an empty list, then tries `/health` plus per-endpoint `/model/info` for older LiteLLM proxies.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -345,6 +345,14 @@ LiteLLM ("litellm") budget
|
|
|
345
345
|
|
|
346
346
|
Automatic polls need Pi's interactive UI and do not run under `LITELLM_OFFLINE=1`, `LITELLM_DISCOVERY_TIMEOUT_MS=0`, or `PI_OFFLINE`; header updates still apply. `/litellm-budget` is stopped by the first two only. The credential and custom headers are kept in memory only as a keyed digest, and proxy responses are reduced to the numbers shown and never logged.
|
|
347
347
|
|
|
348
|
+
When LiteLLM refuses a request because a budget is used up, the error says which budget, its spend and limit, and when it resets, in local time, instead of the proxy's reply:
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
Error: LiteLLM ("litellm"): out of budget. The team budget is used up ($1,000.50 of $1,000) and resets in 2d (2026-11-01 01:00).
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
LiteLLM 1.104.0 and later answer such a request with 422, and earlier releases with 429 or 400; the extension recognises the refusal by its text, whatever the status. Pi does not retry it. It used to retry LiteLLM's own text whenever that held a number like `500`. The figures and the reset come from the budget status, polled again for each refusal under the conditions automatic polls need. Without them, with `budget.enabled` set to `false`, or when the level cannot be read, the error says only which budget is used up. Budgets the footer does not show (end user, tag, project, model access group, and the proxy's own budget), budget windows (`budget_limits`), and per-model budgets keep LiteLLM's text after `out of budget.`, because they reset on their own schedules.
|
|
355
|
+
|
|
348
356
|
## Model transport
|
|
349
357
|
|
|
350
358
|
A `/model/info` route group uses native Anthropic `/v1/messages` only when every deployment explicitly reports Chat mode, identifies a Claude backend through an Anthropic-, Bedrock-, or Vertex-capable adapter, and every declared backend identity resolves the same Anthropic compatibility policy. A `claude-<name>-<major>-<minor>` backend id resolves through its `claude-<name>-<major>` entry when the exact id is absent; an unknown generation stays on Chat Completions. When `supported_endpoints` is a list, it must include `/v1/messages`; an explicit endpoint list without it keeps the group on Chat Completions. A `null` value, which LiteLLM v1.100 and later report for models absent from their model map, counts as absent. An unresolved routing or base-model identity denies native Messages rather than being discarded from the unanimity check. Mixed-generation Claude groups can use Messages when their serializer policies match, with reasoning levels restricted to their common supported set. Groups with incompatible policies, mixed families, or unknown backend evidence remain on Chat Completions; unanimous explicit Responses mode takes precedence. Routes discovered through `/health` never select native Messages: Messages candidates are downgraded to Chat Completions with reasoning controls closed, while correlated Responses detail remains on Responses. Evidence-free `/v1/models` and wholly health-only `/health` groups take transport and presentation metadata from the bounded Pi catalog lookup: `openai-responses` when the catalog says so, otherwise Chat Completions. They expose no speculative reasoning selector and never select native Messages. Catalog identity such as Amazon Bedrock remains separate from the selected wire protocol.
|
|
@@ -417,10 +425,11 @@ such as OpenAI's GPT-6 Luna, is published as both a chat model and a classifier.
|
|
|
417
425
|
| `LITELLM_PROVIDERS` | unset | Canonical comma- or whitespace-separated list of provider IDs to register. |
|
|
418
426
|
| `LITELLM_PROVIDERS_JSON` | unset | JSON string of provider configuration objects matching the `litellm.providers` settings schema. |
|
|
419
427
|
| `LITELLM_PROVIDER_<NAME>_*` | unset | Per-provider environment variables for base URL, API key, headers, display name, OAuth, Google auth, and MCP enable/disable toggle (`_ENABLE_MCP` / `_MCP_ENABLED`). See [Multi-provider environment variables](#multi-provider-environment-variables). |
|
|
428
|
+
| `LITELLM_STARTUP_KEY_HELPER` | unset | If set to `1`, activation runs `LITELLM_API_KEY_HELPER` (or the configured key helper) once to seed models at startup. Without it the helper is never run at activation, so a helper-only setup has no models in `pi -p` print mode until a refresh. |
|
|
420
429
|
| `LITELLM_GCLOUD_TOKEN_AUTH` | unset | If set to a non-empty value other than `0`, use Google Application Default Credentials as the LiteLLM bearer token source. This takes precedence over `LITELLM_API_KEY_HELPER` and `LITELLM_API_KEY` when no stored `/login litellm` credential exists. |
|
|
421
430
|
| `GOOGLE_APPLICATION_CREDENTIALS` | Google default ADC path | Optional path to an ADC JSON file used by `LITELLM_GCLOUD_TOKEN_AUTH`. If unset, the extension checks the default gcloud ADC locations. |
|
|
422
431
|
| `LITELLM_OFFLINE` | unset | If `1`, disable all model and MCP discovery, including post-login discovery; use cached models only when their stored canonical proxy root exactly matches the active credential root, including any path prefix. URL-standard host casing and default ports are canonicalized, but paths remain case-sensitive. |
|
|
423
|
-
| `PI_OFFLINE` | unset | Pi documents it as disabling automatic network activity, including model catalog refreshes. Through Pi 1.
|
|
432
|
+
| `PI_OFFLINE` | unset | Pi documents it as disabling automatic network activity, including model catalog refreshes. Through Pi 1.4.0, any set value (including `0` or an empty string) disables startup model discovery and `/model` network refreshes. Run `/litellm-refresh`, or unset it, to discover; cached models can still be used offline. |
|
|
424
433
|
| `LITELLM_DISCOVERY_TIMEOUT_MS` | `5000` | Background and explicit discovery fetch timeout in ms; `0` disables automatic discovery |
|
|
425
434
|
| `LITELLM_CLI_JWT_EXPIRATION_HOURS` | `24` | CLI SSO token lifetime fallback for older proxies whose poll response omits `expires_in`; mirror a non-default proxy setting locally |
|
|
426
435
|
| `LITELLM_VERBOSE_DISCOVERY` | unset | If `1`, enable progress messages during model discovery (login, refresh, startup), including startup skip reasons and defaulted `/model/info` context windows. Progress messages are off by default |
|
|
@@ -428,7 +437,7 @@ such as OpenAI's GPT-6 Luna, is published as both a chat model and a classifier.
|
|
|
428
437
|
| `LITELLM_TRUST_PROXY_LIMITS` | unset | If `1`, a deployment's explicit `model_info.max_input_tokens` / `max_output_tokens` win over Pi's catalog instead of taking the smaller of the two; the catalog still fills missing values and the group minimum still applies. A `models.json` `modelOverrides` entry still wins first |
|
|
429
438
|
| `LITELLM_MODELS_DEV` | unset | If `1`, enrich discovered metadata (limits, prices, effort lists) from models.dev, cached for 28 days in `litellm-models-dev.json`. Off by default because LiteLLM's `/model/info` is authoritative; use it when LiteLLM's model map lacks a model's metadata |
|
|
430
439
|
|
|
431
|
-
Only use a trusted `LITELLM_API_KEY_HELPER` or `!command`. Prefer an absolute executable path, keep secrets out of command arguments, and print only the token to stdout without logging it to stderr.
|
|
440
|
+
Only use a trusted `LITELLM_API_KEY_HELPER` or `!command`. Prefer an absolute executable path, keep secrets out of command arguments, and print only the token to stdout without logging it to stderr. With `LITELLM_STARTUP_KEY_HELPER=1` the helper also runs at startup, so set that flag only from a launcher you trust.
|
|
432
441
|
|
|
433
442
|
With `LITELLM_VERBOSE_DISCOVERY=1`, `/model/info` discovery reports published routes whose context window uses the fallback assumption (including wildcard expansions) on one line with the selected value, a count, and a sample of escaped route names. Each route is reported once per process. Explicit or authoritative catalog limits do not trigger it, even when numerically equal to the default. Set `model_info.max_input_tokens` on every deployment in the route to provide real limits; this diagnostic does not change discovery limits or routing.
|
|
434
443
|
|
|
@@ -456,6 +465,8 @@ The extension registers at startup and updates the registration before each agen
|
|
|
456
465
|
|
|
457
466
|
Before registering, the extension sends the proxy one MCP `initialize` with the credential and headers Pi will send, and ends the session it opened. LiteLLM 1.102.0 and later refuse it with 403 when no MCP servers are granted to the key, its team, or its organization, or none of them is allowed from your IP address. The extension then registers the server disabled: Pi does not connect to it, warn about it at startup, or turn on `codemode` for it, and `/mcp` lists it as disabled. Once servers are granted, enable it in `/mcp` for the session, or restart Pi, which checks again, as does a login. When a key helper (a `!command` key) or Google ADC is configured, the check is skipped and the server is registered enabled.
|
|
458
467
|
|
|
468
|
+
A proxy that checks budgets on `initialize` refuses it with its budget error once a budget is used up, and every MCP call then fails until the budget resets. The extension registers the server disabled in that case too, and says so once: `LiteLLM MCP ("litellm"): out of budget, so its MCP server is off for this session. Turn it on in /mcp once the budget resets.` After the reset, enable it in `/mcp` or restart Pi.
|
|
469
|
+
|
|
459
470
|
Pi reads the provider's credential when it sends each request, not when the server was registered. If another Pi process stores a login for a different proxy, this session's open connection can send that credential to the previous proxy until the next turn moves the server.
|
|
460
471
|
|
|
461
472
|
Earlier versions discovered tools through `/mcp-rest/tools/list` and registered them as `mcp_<server>_<tool>_<hash>`. Those names and the `<server>/<tool>` form of `toolExposure` keys no longer apply, and the `~/.pi/agent/litellm-mcp-pauses/` directory is no longer used.
|
|
@@ -475,7 +486,9 @@ If your LiteLLM proxy exposes `/claude-code/marketplace.json`, enabled skills ar
|
|
|
475
486
|
## PiG
|
|
476
487
|
|
|
477
488
|
A Go port for [PiG](https://github.com/MichaelKinsy/PiG) lives in [`pig/`](pig/README.md). It reads the same
|
|
478
|
-
settings, environment variables and `auth.json` entries; see [pig/README.md](pig/README.md) to install it.
|
|
489
|
+
settings, environment variables and `auth.json` entries; see [pig/README.md](pig/README.md) to install it. A PiG native
|
|
490
|
+
provider cannot yet surface image or classifier models, so the port does not publish image generation or decision
|
|
491
|
+
routes.
|
|
479
492
|
|
|
480
493
|
## Mocked LiteLLM smoke workflow
|
|
481
494
|
|
|
@@ -502,13 +515,15 @@ npm run supply-chain:guard
|
|
|
502
515
|
npm pack --dry-run
|
|
503
516
|
```
|
|
504
517
|
|
|
518
|
+
Changes to the Go port in `pig/` are verified separately; see [pig/README.md](pig/README.md) for its `go test` and `pig package validate` steps.
|
|
519
|
+
|
|
505
520
|
The published npm package contains only `src`, `README.md`, `LICENSE`, and the `package.json` npm always includes. Pi loads the TypeScript source entrypoint for both npm and Git installs. The package does not expose a JavaScript or TypeScript library import; load it through Pi.
|
|
506
521
|
|
|
507
522
|
## Release
|
|
508
523
|
|
|
509
|
-
Releases are driven by semver tags named `v*.*.*`. The GitHub release workflow installs from the lockfile, then `npm publish` runs `prepublishOnly` to check the source, build `dist` for verification, verify the package contents, and publish to npm with provenance before the workflow creates a GitHub release.
|
|
524
|
+
Releases are driven by semver tags named `v*.*.*`. The GitHub release workflow installs from the lockfile, then `npm publish` runs `prepublishOnly` to check the source, build `dist` for verification, verify the package contents, and publish to npm with provenance before the workflow creates a GitHub release. The same tag publishes the Go port from `pig/` as `pig-provider-litellm`.
|
|
510
525
|
|
|
511
|
-
Before tagging a release, keep `package.json` and `package
|
|
526
|
+
Before tagging a release, keep the `package.json`, `package-lock.json` and `pig/package.json` versions in sync and verify the dry-run package contents.
|
|
512
527
|
|
|
513
528
|
## Model catalog
|
|
514
529
|
|
|
@@ -545,7 +560,7 @@ Each distinct availability diagnostic is written once per session on stderr. `LI
|
|
|
545
560
|
|
|
546
561
|
Discovery selects native Messages for proven Claude groups under the [Model transport](#model-transport) rules, Responses for OpenAI-family backends, and Chat Completions for other OpenAI-compatible backends. Azure deployments stay on Chat Completions unless an explicit Responses mode or a `supported_endpoints` list containing `/v1/responses` authorizes Responses; `api_version` alone does not prove support. Azure AI (`azure_ai/` prefix or `custom_llm_provider: azure_ai`) deployments additionally depend on the proxy version. On LiteLLM before v1.103.0, or when the version is unknown, they ignore a `supported_endpoints` list that contains `/v1/responses` and need an explicit `mode: "responses"`: those releases have no native Responses config for that provider, so they bridge `/v1/responses` through Chat Completions, and the bridge fails streaming with `list index out of range` on Azure's empty-choices chunks (BerriAI/litellm#34455) while the endpoint list, copied from the model cost map, still advertises `/v1/responses`. From v1.103.0 the list is honored again. Discovery reads the version from the `x-litellm-version` header of one extra request, `GET /v1/responses/resp_version_probe`, sent only when such a deployment is published; LiteLLM answers it with an error and calls no model. A pre-release counts as older than the release it names, and a proxy that omits the header keeps these deployments on Chat Completions. Azure is detected from the adapter field, an `azure/` or `azure_ai/` model prefix, or the reported provider; other adapters follow the backend family because LiteLLM bridges `/v1/responses` to Chat Completions when the provider has no native Responses config (`litellm/responses/main.py`, `_bridges_to_chat_completions`). The family comes from the model id, not from LiteLLM's `openai/`, `openai_like/` or `custom_openai/` adapter prefix, so `openai/qwen3` stays on Chat Completions while `openai/gpt-5.5` uses Responses; a deployment opts into Responses with `mode: "responses"` or a `supported_endpoints` list containing `/v1/responses`. A route whose model prefix and `custom_llm_provider` name different providers is treated as unidentified and stays on Chat Completions, so it also does not get the local 128-tool preflight. When `/model/info` supplies `supported_endpoints`, that list takes precedence, and `mode: "responses"` remains an explicit Responses signal. An evidence-free fallback entry—a bare `/v1/models` id or a `/health` entry with no detail row—takes its protocol from the Pi catalog entry for its id; both evidence-free fallback paths also inherit presentation metadata from the bounded catalog lookup. An unknown id stays on Chat Completions. The route name alone authorizes nothing. A concrete id expanded from wildcard `/model/info` routes inherits the deployment evidence of the wildcard route LiteLLM would select for it, with the requested id substituted into the row's `model` the way LiteLLM serves it; the id is omitted when that selected route is not a published chat-style route. Chat Completions and Responses use `<root>/v1`; native Messages uses the proxy root directly. All three protocols pass through the provider's host guard. When an evidence-free cached `(no metadata)` entry can be enriched from the Pi catalog, it is restored on Responses only for a catalog Responses model and otherwise on Chat Completions, never Anthropic Messages. A model supplied only through `models.json` whose `api` this provider does not implement takes Pi's global API fallback rather than this provider's host guard; the credential-root pin (see [Model host enforcement](#model-host-enforcement)) still keeps the credential on the active proxy.
|
|
547
562
|
|
|
548
|
-
`cacheControlFormat: "anthropic"` applies only to Chat Completions, where Pi adds Anthropic `cache_control` markers. The Responses transport has a different compatibility type and uses native `prompt_cache_key` (plus supported retention fields), so Responses models must not receive `cacheControlFormat`. Freshly discovered OpenAI-family models forced onto Chat Completions are rejected locally when a request contains more than 128 tools; route them through Responses or reduce enabled extensions. Moonshot request-side reasoning suppression follows LiteLLM's routing provider, not `model_info.base_model`; response-side `<think>` normalization follows discovered Kimi-family evidence. Opaque aliases retain display normalization without sending Moonshot-only parameters to Azure- or Bedrock-hosted Kimi models. Strict tool-message repair requires every deployment to identify Kimi; Gemini effort normalization likewise requires consistent backend-family evidence. Claude-backed routes on native Messages or Chat Completions declare Pi's `promptCache` lifetimes (`short: 300`, `long: 3600` seconds, the values Pi's built-in Anthropic models use), so Pi's `cacheWarming` can keep their caches warm. Responses routes, routes identified only by their name, and other backend families declare none, so Pi does not warm them. A `modelOverrides` entry for the route in the global `models.json` can change the values, and `cacheWarming: "off"` disables warming.
|
|
563
|
+
`cacheControlFormat: "anthropic"` applies only to Chat Completions, where Pi adds Anthropic `cache_control` markers. The Responses transport has a different compatibility type and uses native `prompt_cache_key` (plus supported retention fields), so Responses models must not receive `cacheControlFormat`. Freshly discovered OpenAI-family models forced onto Chat Completions are rejected locally when a request contains more than 128 tools; route them through Responses or reduce enabled extensions. Moonshot request-side reasoning suppression follows LiteLLM's routing provider, not `model_info.base_model`; response-side `<think>` normalization follows discovered Kimi-family evidence. Opaque aliases retain display normalization without sending Moonshot-only parameters to Azure- or Bedrock-hosted Kimi models. Strict tool-message repair requires every deployment to identify Kimi; Gemini effort normalization likewise requires consistent backend-family evidence. Claude-backed routes on native Messages or Chat Completions declare Pi's `promptCache` lifetimes (`short: 300`, `long: 3600` seconds, the values Pi's built-in Anthropic models use), so Pi's `cacheWarming` can keep their caches warm. Responses routes whose every deployment is GPT-5.6 or later and routes through LiteLLM's `openai`, `azure` or `azure_ai` provider declare `short: 1800`, the 30-minute default minimum lifetime OpenAI and Azure document for those models, and no `long` value. Claude routes on Responses, Chat routes to OpenAI models, earlier GPT models, GPT models served through a relay such as OpenRouter or GitHub Copilot, routes identified only by their name, and other backend families declare none, so Pi does not warm them. A `modelOverrides` entry for the route in the global `models.json` can change the values, and `cacheWarming: "off"` disables warming.
|
|
549
564
|
|
|
550
565
|
Discovery policy is versioned in Pi's persisted model catalog. After upgrading, an online refresh replaces legacy entries. Offline legacy entries remain usable without a diagnostic; the extension reports the discovery-version mismatch once only when an attempted online refresh fails. To force rediscovery or roll back across this policy change, delete the `litellm` entry from `~/.pi/agent/models-store.json` (or delete the file) and refresh once online.
|
|
551
566
|
|
|
@@ -599,7 +614,7 @@ The development probe runs against minimized snapshots with `npm run probe:proxy
|
|
|
599
614
|
| "no credentials" warning at startup | Env vars not set and no OAuth credential — run `/login litellm` |
|
|
600
615
|
| No models, or no new routes, while `PI_OFFLINE` is set | Pi skips every model network refresh, including the one `/model` starts. Run `/litellm-refresh`, or unset `PI_OFFLINE` (`PI_OFFLINE=0` is not enough) |
|
|
601
616
|
| `No models available` at startup, gone after a restart | A Pi startup race, not discovery — see [`No models available` at startup](#no-models-available-at-startup) |
|
|
602
|
-
|
|
|
617
|
+
| `/litellm-refresh` reports `refreshed 0 models` | Proxy returned an empty list — check pi's startup log and verify `/model/info`, `/v1/models`, or `/health` responds |
|
|
603
618
|
| `/model/info` returning 401/403/404 or an empty list | Expected behavior with virtual keys — extension falls back to `/v1/models` |
|
|
604
619
|
| Discovery times out | Increase `LITELLM_DISCOVERY_TIMEOUT_MS` or set `LITELLM_OFFLINE=1` to fall back on cached models. Offline mode does not recover a root mismatch, including a different path prefix — see [Model host enforcement](#model-host-enforcement) |
|
|
605
620
|
| A provider shows no models | The base URL is missing, invalid, still the placeholder, or its full root, including any path prefix, differs from the root in the cached catalog. Check stderr and see [Model host enforcement](#model-host-enforcement) |
|
|
@@ -608,14 +623,15 @@ The development probe runs against minimized snapshots with `npm run probe:proxy
|
|
|
608
623
|
| `LiteLLM discovery: ... route group(s) mix chat-style and explicitly incompatible deployment modes` | A public route can select both a chat-style deployment and an incompatible deployment such as an embedding model. Give the embedding deployment its own `model_name`. |
|
|
609
624
|
| `LiteLLM (...): the request for "<route>" was answered by a fallback` | A successful HTTP response reports a LiteLLM router fallback (`x-litellm-attempted-fallbacks`). `/model/info` does not expose fallbacks, so protocol and model handling follow the requested route's own deployments. If the primary and fallback groups support Chat Completions, set `model_info.supported_endpoints: ["/v1/chat/completions"]` on the primary to avoid Responses-to-Chat bridging. This warning does not change routing or fix upstream bridging defects. It names only the requested route; LiteLLM reports the group and model that answered in the `x-litellm-model-group` and `x-litellm-model-name` response headers. Warned once per provider and route until the extension reloads; shown in the UI, or stderr without a UI. |
|
|
610
625
|
| A model is marked ` (incomplete metadata)` | `/model/info` or `/health` did not provide enough authoritative metadata. Explicit fields remain usable, but unknown cost fields are shown as zero and route-name cache enrichment stays disabled. |
|
|
611
|
-
| Cache miss notices after idle, no cache warming | The model declares no `promptCache`: only Claude-backed Messages and Chat routes get one. Run `/litellm-refresh` after updating so stored models are rediscovered. |
|
|
626
|
+
| Cache miss notices after idle, no cache warming | The model declares no `promptCache`: only Claude-backed Messages and Chat routes and GPT-5.6+ Responses routes on OpenAI or Azure get one. Run `/litellm-refresh` after updating so stored models are rediscovered. |
|
|
612
627
|
| `401 Token expired` | Set `LITELLM_API_KEY_HELPER`. |
|
|
613
628
|
| No models with gcloud auth | Verify `gcloud auth application-default login` has been run or set `GOOGLE_APPLICATION_CREDENTIALS` to an `authorized_user` ADC file |
|
|
614
629
|
| Enterprise SSO waits for token insertion | The proxy returned 404/405 for `/sso/cli/start`, so Pi used the legacy flow — upgrade LiteLLM or paste the UI token |
|
|
615
630
|
| Enterprise CLI SSO start/poll fails | Check the proxy logs and verify `/sso/cli/start` and `/sso/cli/poll/{login_id}` are reachable; only 404/405 falls back to legacy login |
|
|
616
631
|
| Enterprise SSO login shows "virtual key generation failed" | The LiteLLM instance may lack a database (`/key/generate` requires one), your user account may lack key-generation permission, or the request timed out; the JWT is used directly as a fallback |
|
|
617
632
|
| Enterprise SSO token prompt fails with "SSO token is required" | The token field was left empty — paste the token copied from the LiteLLM UI |
|
|
618
|
-
|
|
|
633
|
+
| `LiteLLM (...): out of budget` | A LiteLLM budget is used up. The error names it and, when the budget status can read it, its reset time; `/litellm-budget` shows every level. Ask the proxy admin to raise the limit, or wait for the reset — see [Budget status](#budget-status) |
|
|
634
|
+
| MCP tools not showing | Run `/mcp` and check the provider's server: its state shows a connection or sign-in error. `disabled` means the proxy refused the key at startup, usually because no MCP servers are granted to it, its team, or its organization, or because a budget is used up, which is reported at startup; after a grant or the budget's reset, enable it in `/mcp` or restart Pi. Verify the proxy serves `/mcp` and that the key has MCP access |
|
|
619
635
|
| MCP tools listed but the model cannot call them | `codemode` and `deferred` tools are reached through Pi's `codemode` and `tool_search` tools. Check that neither is disabled; `--no-extensions` disables them and Pi's MCP client alike. Setting `litellm.mcp.exposure` to `direct` declares the tools on every request instead |
|
|
620
636
|
| Skills not affecting prompts | Verify the proxy exposes `/claude-code/marketplace.json` or `/v1/skills` and returns enabled skills |
|
|
621
637
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-provider-litellm",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "LiteLLM proxy provider extension for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"basic-ftp": "6.0.1",
|
|
64
64
|
"nanoid": "3.3.18",
|
|
65
65
|
"protobufjs": "8.7.1",
|
|
66
|
-
"undici": "8.
|
|
66
|
+
"undici": "8.12.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@biomejs/biome": "^2.4.15",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
75
75
|
"es-module-lexer": "^3.0.2",
|
|
76
76
|
"tsx": "^4.21.0",
|
|
77
|
-
"typebox": "1.4.
|
|
77
|
+
"typebox": "1.4.3",
|
|
78
78
|
"vitest": "^5.0.0"
|
|
79
79
|
}
|
|
80
80
|
}
|
package/src/backend-identity.ts
CHANGED
package/src/budget.ts
CHANGED
|
@@ -311,6 +311,65 @@ export function formatBudgetDetails(
|
|
|
311
311
|
return lines.join("\n");
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
// LiteLLM refuses a used-up budget with `type: "budget_exceeded"` (status 422 since 1.104, 429 or 400 before), and
|
|
315
|
+
// /mcp with the bare message, whose wording varies by level and check.
|
|
316
|
+
const BUDGET_EXCEEDED = /budget_exceeded|Budget has been exceeded!|ExceededBudget:|exceeded budget for model=/;
|
|
317
|
+
// The refusals of a level's own budget. Budget windows and per-model budgets reset on schedules of their own.
|
|
318
|
+
const EXCEEDED_LEVEL =
|
|
319
|
+
/Budget has been exceeded! (Key|Team|TeamMember|User|Organization)=\S*( in Team=)?|ExceededBudget: (User)=.+? over budget\./;
|
|
320
|
+
const EXCEEDED_LEVELS: Record<string, BudgetLevelName> = {
|
|
321
|
+
Key: "key",
|
|
322
|
+
Team: "team",
|
|
323
|
+
TeamMember: "member",
|
|
324
|
+
User: "user",
|
|
325
|
+
Organization: "org",
|
|
326
|
+
};
|
|
327
|
+
const LEVEL_LABELS: Record<BudgetLevelName, string> = {
|
|
328
|
+
key: "key",
|
|
329
|
+
user: "user",
|
|
330
|
+
team: "team",
|
|
331
|
+
member: "team member",
|
|
332
|
+
org: "organization",
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export const isBudgetExceeded = (text: string): boolean => BUDGET_EXCEEDED.test(text);
|
|
336
|
+
|
|
337
|
+
// Local time in one fixed format, which the Go port prints the same way.
|
|
338
|
+
function resetClock(resetAt: number): string {
|
|
339
|
+
const at = new Date(resetAt);
|
|
340
|
+
const pad = (n: number) => String(n).padStart(2, "0");
|
|
341
|
+
return `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())} ${pad(at.getHours())}:${pad(at.getMinutes())}`;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Starts with "out of budget", which Pi and PiG never retry. A refusal whose level is not tracked keeps the proxy's
|
|
345
|
+
// text, as that names the budget.
|
|
346
|
+
export function formatBudgetExceeded(errorText: string, levels: BudgetLevels, now: number): string {
|
|
347
|
+
const match = EXCEEDED_LEVEL.exec(errorText);
|
|
348
|
+
if (!match) return `out of budget. ${errorText}`;
|
|
349
|
+
const name = match[2] ? "member" : EXCEEDED_LEVELS[match[1] ?? match[3]!]!;
|
|
350
|
+
const l = levels[name];
|
|
351
|
+
const amounts = l ? ` (${money(l.spend, 2)} of ${money(l.maxBudget, Number.isInteger(l.maxBudget) ? 0 : 2)})` : "";
|
|
352
|
+
const reset = formatRelativeReset(l?.resetAt, now);
|
|
353
|
+
const resets = reset ? ` and resets in ${reset} (${resetClock(l!.resetAt!)})` : "";
|
|
354
|
+
return `out of budget. The ${LEVEL_LABELS[name]} budget is used up${amounts}${resets}.`;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function setupLiteLLMBudgetErrors(
|
|
358
|
+
pi: ExtensionAPI,
|
|
359
|
+
providerNames: ReadonlySet<string>,
|
|
360
|
+
levelsAfterError?: (ctx: ExtensionContext, name: string) => Promise<BudgetLevels>,
|
|
361
|
+
): void {
|
|
362
|
+
pi.on("message_end", async (event, ctx) => {
|
|
363
|
+
const message = event.message;
|
|
364
|
+
if (message.role !== "assistant" || message.stopReason !== "error" || !providerNames.has(message.provider)) return;
|
|
365
|
+
const text = message.errorMessage ?? "";
|
|
366
|
+
if (!isBudgetExceeded(text)) return;
|
|
367
|
+
const levels = (await levelsAfterError?.(ctx, message.provider).catch(() => undefined)) ?? {};
|
|
368
|
+
const explained = formatBudgetExceeded(text, levels, Date.now());
|
|
369
|
+
return { message: { ...message, errorMessage: `LiteLLM (${JSON.stringify(message.provider)}): ${explained}` } };
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
314
373
|
export function budgetDisplaySetting(budgetSettings: unknown): { display: BudgetDisplay; warning?: string } {
|
|
315
374
|
const display = obj(budgetSettings)?.display;
|
|
316
375
|
if (display === undefined || display === "all" || display === "tightest") return { display: display ?? "all" };
|
|
@@ -344,7 +403,10 @@ interface ProviderState {
|
|
|
344
403
|
inFlight?: Promise<PollOutcome>;
|
|
345
404
|
}
|
|
346
405
|
|
|
347
|
-
export function setupLiteLLMBudget(
|
|
406
|
+
export function setupLiteLLMBudget(
|
|
407
|
+
pi: ExtensionAPI,
|
|
408
|
+
options: BudgetOptions,
|
|
409
|
+
): (ctx: ExtensionContext, name: string) => Promise<BudgetLevels> {
|
|
348
410
|
const displayNames = new Map(options.providers.map(({ name, displayName }) => [name, displayName]));
|
|
349
411
|
const states = new Map<string, ProviderState>();
|
|
350
412
|
// Keyed like the MCP registration identity in index.ts, because custom headers can carry gateway credentials.
|
|
@@ -558,4 +620,11 @@ export function setupLiteLLMBudget(pi: ExtensionAPI, options: BudgetOptions): vo
|
|
|
558
620
|
}
|
|
559
621
|
},
|
|
560
622
|
});
|
|
623
|
+
|
|
624
|
+
// The levels a budget refusal is explained with. Polled for each refusal, joining a poll in flight, because only a
|
|
625
|
+
// poll notices that the credential changed since the last one.
|
|
626
|
+
return async (ctx, name) => {
|
|
627
|
+
if (ctx?.hasUI && !gated()) await poll(ctx, name);
|
|
628
|
+
return stateFor(name).levels;
|
|
629
|
+
};
|
|
561
630
|
}
|
package/src/discover.ts
CHANGED
|
@@ -55,6 +55,11 @@ const DEFAULT_TIMEOUT_MS = 5000;
|
|
|
55
55
|
// shortcut: `long` assumes the host offers the 1-hour TTL (Bedrock only does for Claude 4.5+), gate it on
|
|
56
56
|
// deployment routing if LiteLLM ever reports per-route TTL support.
|
|
57
57
|
const CLAUDE_PROMPT_CACHE = { short: 300, long: 3600 } as const;
|
|
58
|
+
// OpenAI's and Azure's documented 30-minute default minimum for GPT-5.6 and later. No `long`: the
|
|
59
|
+
// 12-hour lifetime needs `prompt_cache_options.ttl`, which Pi's long retention does not request.
|
|
60
|
+
const OPENAI_PROMPT_CACHE = { short: 1800 } as const;
|
|
61
|
+
// Relays (OpenRouter, Copilot, resellers) document no lifetime of their own and may bill or route differently.
|
|
62
|
+
const OPENAI_PROMPT_CACHE_ROUTES: ReadonlySet<string> = new Set(["openai", "azure", "azure_ai"]);
|
|
58
63
|
const HEALTH_DETAIL_CONCURRENCY = 8;
|
|
59
64
|
const reportedConflictingFamilyRoutes = new Set<string>();
|
|
60
65
|
const reportedWithheldRepairRoutes = new Set<string>();
|
|
@@ -132,6 +137,12 @@ export function isGpt55OrNewerModel(modelId: string): boolean {
|
|
|
132
137
|
return generation !== undefined && (generation[0] > 5 || (generation[0] === 5 && generation[1] >= 5));
|
|
133
138
|
}
|
|
134
139
|
|
|
140
|
+
// GPT-5.6 and later keep a cached prefix for at least 30 minutes by default.
|
|
141
|
+
function isGpt56OrNewerModel(modelId: string): boolean {
|
|
142
|
+
const generation = gptGeneration(modelId);
|
|
143
|
+
return generation !== undefined && (generation[0] > 5 || (generation[0] === 5 && generation[1] >= 6));
|
|
144
|
+
}
|
|
145
|
+
|
|
135
146
|
// GPT-6 also rejects an omitted effort there: it falls back to its default effort.
|
|
136
147
|
export function isGpt6OrNewerModel(modelId: string): boolean {
|
|
137
148
|
const generation = gptGeneration(modelId);
|
|
@@ -726,7 +737,8 @@ function mapFromModelInfoGroup(
|
|
|
726
737
|
const protocols = entries.map((entry) => modelProtocol(reduced.id, entry, options.proxyVersion));
|
|
727
738
|
const protocol = protocols.find((candidate) => candidate.api === "openai-completions") ?? protocols[0]!;
|
|
728
739
|
const api = reduced.api === "anthropic-messages" ? reduced.api : protocol.api;
|
|
729
|
-
const
|
|
740
|
+
const identities = entries.map((entry) => resolveBackendIdentity({ ...entry, model_name: undefined }));
|
|
741
|
+
const families = new Set(identities.map((identity) => identity?.family));
|
|
730
742
|
const [family] = families;
|
|
731
743
|
const hasBackendEvidence = entries.some(hasReadableBackendEvidence);
|
|
732
744
|
const reasoningPolicy =
|
|
@@ -788,10 +800,7 @@ function mapFromModelInfoGroup(
|
|
|
788
800
|
);
|
|
789
801
|
// One GPT-5.5+ deployment is enough: a tool request routed to it fails with
|
|
790
802
|
// reasoning attached, while dropping reasoning elsewhere only loses effort.
|
|
791
|
-
const chatBackendIds =
|
|
792
|
-
api === "openai-completions"
|
|
793
|
-
? entries.flatMap((entry) => resolveBackendIdentity({ ...entry, model_name: undefined })?.modelId ?? [])
|
|
794
|
-
: [];
|
|
803
|
+
const chatBackendIds = api === "openai-completions" ? identities.flatMap((identity) => identity?.modelId ?? []) : [];
|
|
795
804
|
const modelPolicy: LiteLLMModelPolicy | undefined = chatBackendIds.some(isGpt55OrNewerModel)
|
|
796
805
|
? {
|
|
797
806
|
normalizeStrictToolMessages: false,
|
|
@@ -821,6 +830,15 @@ function mapFromModelInfoGroup(
|
|
|
821
830
|
...(families.size === 1 && family === "claude" && relaysAnthropicCacheMarkers
|
|
822
831
|
? { promptCache: { ...CLAUDE_PROMPT_CACHE } }
|
|
823
832
|
: {}),
|
|
833
|
+
...(api === "openai-responses" &&
|
|
834
|
+
identities.every(
|
|
835
|
+
(identity, index) =>
|
|
836
|
+
identity?.family === "openai" &&
|
|
837
|
+
isGpt56OrNewerModel(identity.modelId) &&
|
|
838
|
+
routesOnlyThrough(entries[index]!, OPENAI_PROMPT_CACHE_ROUTES),
|
|
839
|
+
)
|
|
840
|
+
? { promptCache: { ...OPENAI_PROMPT_CACHE } }
|
|
841
|
+
: {}),
|
|
824
842
|
...(modelPolicy ? { litellmPolicy: modelPolicy } : {}),
|
|
825
843
|
// closeSerializerPolicy derives compat from `api`, a correlation its return type cannot carry.
|
|
826
844
|
} as DiscoveredModel;
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { ExtensionAPI, ExtensionContext, McpServerConfig } from "@earendil-
|
|
|
18
18
|
// A namespace import, so a Pi without `VERSION` reaches the version check instead of failing to link.
|
|
19
19
|
import * as piCodingAgent from "@earendil-works/pi-coding-agent";
|
|
20
20
|
import { getAgentDir, readStoredCredential } from "@earendil-works/pi-coding-agent";
|
|
21
|
-
import { budgetDisplaySetting, setupLiteLLMBudget } from "./budget.js";
|
|
21
|
+
import { budgetDisplaySetting, isBudgetExceeded, setupLiteLLMBudget, setupLiteLLMBudgetErrors } from "./budget.js";
|
|
22
22
|
import type { LiteLLMClassifierModel } from "./classifiers.js";
|
|
23
23
|
import { setupLiteLLMCostTracking } from "./cost.js";
|
|
24
24
|
import {
|
|
@@ -67,6 +67,7 @@ const ENV_CLI_JWT_EXPIRATION_HOURS = "LITELLM_CLI_JWT_EXPIRATION_HOURS";
|
|
|
67
67
|
const ENV_OFFLINE = "LITELLM_OFFLINE";
|
|
68
68
|
const ENV_VERBOSE_DISCOVERY = "LITELLM_VERBOSE_DISCOVERY";
|
|
69
69
|
const ENV_MODELS_DEV = "LITELLM_MODELS_DEV";
|
|
70
|
+
const ENV_STARTUP_KEY_HELPER = "LITELLM_STARTUP_KEY_HELPER";
|
|
70
71
|
const MODELS_DEV_CACHE_FILENAME = "litellm-models-dev.json";
|
|
71
72
|
const DEFAULT_TIMEOUT_MS = 5000;
|
|
72
73
|
const SEED_TIMEOUT_MS = 3000;
|
|
@@ -723,6 +724,19 @@ function piLiteral(value: string): string {
|
|
|
723
724
|
return escaped.startsWith("!") ? `$${escaped}` : escaped;
|
|
724
725
|
}
|
|
725
726
|
|
|
727
|
+
// The first 64 KiB of a body, as much as the MCP access check reads of a refusal.
|
|
728
|
+
async function readBodyPrefix(response: Response, limit = 64 * 1024): Promise<string> {
|
|
729
|
+
if (!response.body) return "";
|
|
730
|
+
const decoder = new TextDecoder();
|
|
731
|
+
let text = "";
|
|
732
|
+
for await (const chunk of response.body) {
|
|
733
|
+
text += decoder.decode(chunk, { stream: true });
|
|
734
|
+
// Leaving the loop cancels the rest of the stream.
|
|
735
|
+
if (text.length >= limit) break;
|
|
736
|
+
}
|
|
737
|
+
return text;
|
|
738
|
+
}
|
|
739
|
+
|
|
726
740
|
/**
|
|
727
741
|
* LiteLLM's /model/info is the metadata authority, so models.dev is an opt-in escape hatch.
|
|
728
742
|
* Without a cache path and with refresh suppressed, discovery reads neither the models.dev
|
|
@@ -2501,8 +2515,12 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2501
2515
|
// LiteLLM 1.102.0 and later answer `initialize` with 403 when the key has no MCP servers granted,
|
|
2502
2516
|
// and Pi warns at every start about a server that fails to connect. Asking first lets such a
|
|
2503
2517
|
// server be registered disabled: Pi neither connects to it nor warns, and /mcp still lists it, so
|
|
2504
|
-
// the user can enable it once servers are granted.
|
|
2505
|
-
|
|
2518
|
+
// the user can enable it once servers are granted. A used-up budget fails every MCP request until
|
|
2519
|
+
// it resets, so it is refused the same way, with a notice.
|
|
2520
|
+
async function mcpAccessRefused(
|
|
2521
|
+
definition: ProviderDefinition,
|
|
2522
|
+
url: string,
|
|
2523
|
+
): Promise<"no-servers" | "out-of-budget" | undefined> {
|
|
2506
2524
|
try {
|
|
2507
2525
|
const stored = readStoredCredential(definition.name, join(getAgentDir(), "auth.json"));
|
|
2508
2526
|
// The check must send the credential Pi will send. Like seeding, it runs no key helper and
|
|
@@ -2515,11 +2533,11 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2515
2533
|
definition.apiKeyConfig?.startsWith("!") ||
|
|
2516
2534
|
useGcloudToken
|
|
2517
2535
|
) {
|
|
2518
|
-
return
|
|
2536
|
+
return undefined;
|
|
2519
2537
|
}
|
|
2520
2538
|
const auth = await authForCredential(definition, stored, false);
|
|
2521
2539
|
// The credential goes only to its own root.
|
|
2522
|
-
if (`${auth.baseUrl}/mcp` !== url) return
|
|
2540
|
+
if (`${auth.baseUrl}/mcp` !== url) return undefined;
|
|
2523
2541
|
// The credential and headers Pi's client sends, so the proxy answers as it will answer Pi.
|
|
2524
2542
|
const headers = { ...auth.headers, Authorization: `Bearer ${auth.apiKey}` };
|
|
2525
2543
|
const response = await fetch(url, {
|
|
@@ -2538,7 +2556,9 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2538
2556
|
redirect: "manual",
|
|
2539
2557
|
signal: AbortSignal.timeout(getSeedTimeoutMs()),
|
|
2540
2558
|
});
|
|
2541
|
-
|
|
2559
|
+
// Only a refusal is read, and only its start: a granted session can answer with an open event stream.
|
|
2560
|
+
const refusal = response.ok ? undefined : await readBodyPrefix(response).catch(() => "");
|
|
2561
|
+
if (refusal === undefined) await response.body?.cancel().catch(() => undefined);
|
|
2542
2562
|
// Pi opens its own session; end the one this check opened.
|
|
2543
2563
|
const session = response.headers.get("mcp-session-id");
|
|
2544
2564
|
if (session) {
|
|
@@ -2551,9 +2571,11 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2551
2571
|
.then((closed) => closed.body?.cancel())
|
|
2552
2572
|
.catch(() => undefined);
|
|
2553
2573
|
}
|
|
2554
|
-
|
|
2574
|
+
// The budget refusal's status is configurable on the proxy, so its text is checked first.
|
|
2575
|
+
if (refusal !== undefined && isBudgetExceeded(refusal)) return "out-of-budget";
|
|
2576
|
+
return response.status === 403 ? "no-servers" : undefined;
|
|
2555
2577
|
} catch {
|
|
2556
|
-
return
|
|
2578
|
+
return undefined;
|
|
2557
2579
|
}
|
|
2558
2580
|
}
|
|
2559
2581
|
|
|
@@ -2574,6 +2596,12 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2574
2596
|
try {
|
|
2575
2597
|
pi.registerMcpServer(definition.name, refused ? { ...config, enabled: false } : config);
|
|
2576
2598
|
attempt.registered = true;
|
|
2599
|
+
if (refused === "out-of-budget") {
|
|
2600
|
+
notifyMcp(
|
|
2601
|
+
`LiteLLM MCP (${JSON.stringify(definition.name)}): out of budget, so its MCP server is off for this ` +
|
|
2602
|
+
"session. Turn it on in /mcp once the budget resets.",
|
|
2603
|
+
);
|
|
2604
|
+
}
|
|
2577
2605
|
} catch (error) {
|
|
2578
2606
|
// The claim stays, so the refusal is reported once rather than on every turn.
|
|
2579
2607
|
notifyMcp(
|
|
@@ -2700,9 +2728,9 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2700
2728
|
const agentDir = getAgentDir();
|
|
2701
2729
|
try {
|
|
2702
2730
|
const stored = readStoredCredential(definition.name, join(agentDir, "auth.json"));
|
|
2703
|
-
//
|
|
2704
|
-
//
|
|
2705
|
-
const auth = await authForCredential(definition, stored,
|
|
2731
|
+
// Activation must not run the user's key helper as a side effect, so helper-backed setups keep waiting
|
|
2732
|
+
// for Pi's own refresh; LITELLM_STARTUP_KEY_HELPER=1 is the launcher's opt-in to run it here.
|
|
2733
|
+
const auth = await authForCredential(definition, stored, process.env[ENV_STARTUP_KEY_HELPER] === "1");
|
|
2706
2734
|
const storedModels = await readStoredModels({
|
|
2707
2735
|
agentDir,
|
|
2708
2736
|
provider: definition.name,
|
|
@@ -2878,10 +2906,11 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2878
2906
|
|
|
2879
2907
|
setupLiteLLMCostTracking(pi, [...providerNames]);
|
|
2880
2908
|
|
|
2909
|
+
let budgetLevels: ReturnType<typeof setupLiteLLMBudget> | undefined;
|
|
2881
2910
|
if (budgetEnabled) {
|
|
2882
2911
|
const { display, warning } = budgetDisplaySetting(settings?.budget);
|
|
2883
2912
|
const definitionNamed = (name: string) => definitions.find((definition) => definition.name === name)!;
|
|
2884
|
-
setupLiteLLMBudget(pi, {
|
|
2913
|
+
budgetLevels = setupLiteLLMBudget(pi, {
|
|
2885
2914
|
providers: definitions.map(({ name, displayName }) => ({ name, displayName })),
|
|
2886
2915
|
display,
|
|
2887
2916
|
displayWarning: warning,
|
|
@@ -2892,6 +2921,7 @@ export default async function (pi: ExtensionAPI): Promise<void> {
|
|
|
2892
2921
|
missingCredentials: (name) => missingCredentials(definitionNamed(name)),
|
|
2893
2922
|
});
|
|
2894
2923
|
}
|
|
2924
|
+
setupLiteLLMBudgetErrors(pi, providerNames, budgetLevels);
|
|
2895
2925
|
|
|
2896
2926
|
if (skillsEnabled) {
|
|
2897
2927
|
for (const tool of createSkillToolDefinitions(resolveDefaultRuntimeAuth)) {
|