@homeflare/distilled-litellm
v0.4.2
Published
Interim npm home for @distilled.cloud/litellm — see docs/distilled-interim.md. Not published upstream yet; the kit aliases @distilled.cloud/litellm onto this package until it is.
Readme
@homeflare/distilled-litellm
This package is not a HomeFlare SDK. It is an unmodified copy of
@distilled.cloud/litellm, generated by the distilled
pipeline from the LiteLLM Proxy's own app.openapi() document at tag
v1.103.0, published here under its own name only because
@distilled.cloud/litellm does not exist on npm yet — the kit builds it in a
local clone of alchemy-run/distilled but, per house policy, never pushes to
that upstream. See
../alchemy/docs/distilled-interim.md
for the full route every distilled-sourced vendor package follows, and why
this one exists at all.
⛔ Do not hand-edit anything under src/. The whole point of the route
above is that this directory is copied, not written — a fix belongs in the
distilled clone's packages/litellm/, regenerated, then copied back here.
⚠️ License. Apache-2.0, not the kit's usual MIT — this content is a
redistribution of alchemy-run/distilled's own Apache-2.0-licensed output,
and relicensing a copy would misstate what it is. See LICENSE.
What's in it
91 service modules, one per LiteLLM Proxy OpenAPI tag — model_management,
key_management, team_management, internal_user_management,
budget_management, misc (the untagged /config/pass_through_endpoint*
family and other UI/debug/login/MCP routes), and every other admin/inference
tag LiteLLM's own API reference groups by (964 operations total, measured from
the generated models; v1.100.0 was 917 in 105 modules). Every
operation gets an Effect-typed, catchTag-able error for every status the
spec declares, plus the undeclared 400/403/404/409 responses this
package's own source-reading found on the primary CRUD routes of the five
admin tags above (patches/{budget,key,team,internal_user,model}_management/*.json
— each patch cites the exact source file:line it was grounded in, at v1.100.0;
re-measured against v1.103.0: every patched status is still raised, only the
lines moved; see ../../litellm/docs/errors.md and
../../litellm/docs/patch-reverification.md in the distilled clone for the
full account).
POST /key/delete also types its 404 and 403 as resource-specific tags, KeyNotFound (message
No keys found) and KeyDeleteForbidden (message not authorized to delete this key), each matched
on the status and that phrase of LiteLLM's own message (patches/key_management/delete_key_fn_key_delete_post.json).
The credential by-name read and delete type their 404 as CredentialNotFound (message
Credential not found), and the credential PATCH carries credential_name in its body as a second
member (credential_name_body, wire-named credential_name) because the vendor's UpdateCredentialItem
requires it there and a Smithy member has one binding (patches/credential_management/{get_credential_by_name_credentials_by_name__credential_name__get,delete_credential_credentials__credential_name__delete,update_credential_credentials__credential_name__patch}.json).
GenerateKeyResponse.key and NewUserResponse.key — the literal virtual-key
value /key/generate, /key/regenerate and /user/new return — decode to
Redacted.Redacted<string> rather than a plain string.
Changed at v1.103.0. LiteLLM moved the routes of fifteen per-provider
* Pass-through tags (anthropic_pass_through, azure_pass_through,
bedrock_pass_through, vertex_ai_pass_through, …) under one
llm_passthrough tag (107 operations), so those fifteen modules are gone and
Services.llmPassthrough is new; open_ai_pass_through shrank from 10 to 5
operations. The kit's own consumers use only budget_management and misc,
which kept every operation they call.
Typed data-plane bodies. POST /rerank, /v1/rerank, /v2/rerank and
/mcp-rest/tools/call read the raw request body, so LiteLLM's OpenAPI document
declares no requestBody for them and the request used to be S.Struct({}).
They now carry typed bodies (RerankRequest: model, query, documents
required; CallMcpToolRestRequest: name required, server_id,
arguments), added by distilled patches grounded in the v1.103.0 source — never
by editing generated files. Responses stay body: unknown, and 72 other
operations still have no declared body: see
../../litellm/docs/data-plane-bodies.md in the distilled clone. scripts/smoke.ts
asserts the typed fields reach the wire as the JSON body the handler reads.
import * as Litellm from '@distilled.cloud/litellm'; // aliased onto this package — see docs/distilled-interim.md
import * as Effect from 'effect/Effect';
const program = Litellm.Services.keyManagement
.generateKeyFnKeyGeneratePost({ key_alias: 'my-service' })
.pipe(
Effect.provide(Litellm.LitellmProtocol),
Effect.provide(Litellm.credentials({ apiKey: '...', baseUrl: 'https://litellm.example.com' })),
);Kit code never imports @homeflare/distilled-litellm directly — always
@distilled.cloud/litellm, aliased in the consuming package's package.json
("@distilled.cloud/litellm": "npm:@homeflare/distilled-litellm@<version>"),
so the eventual cutover to the real published package is a one-line alias
swap with no import changes anywhere in the kit.
Updating it
From the distilled clone's homeflare/litellm worktree, with the spec dumped
the way codegen/manifest.json's litellm-openapi entry records (copy it to
packages/litellm/specs/.local/specs/):
DISTILLED_SPECS_LOCAL=1 pnpm generate litellm # convert + generate + format
pnpm exec tsc -b packages/litellm --noCheck false # scoped; never the whole graph
pnpm specs:checkThen mirror src/ here byte for byte — rsync -a --delete, not cp -R: the
generator never removes a module whose tag disappeared (v1.103.0 dropped
fifteen), and scripts/prune-services.ts in the clone only cleans the clone.
Check with diff -rq, add a changeset (a minor while the generated surface
changes shape) and let the kit's normal release flow bump the version and
publish it — never edit version or CHANGELOG.md by hand
(docs/releasing.md).
License
Apache-2.0 (see LICENSE) — not the kit's usual MIT. src/ is an
unmodified copy of @distilled.cloud/litellm's own output from
alchemy-run/distilled, which is itself Apache-2.0; this package's own
files (package.json, tsconfig.json, scripts/smoke.ts, this README)
are offered under the same terms.
