chore(ci): promote internal staging to main - #37042
Conversation
…36724) * fix(mcp): expose client HTTP headers to logging callbacks and hooks MCP protocol tool calls built a synthetic Request with only content-type, so metadata.headers reaching logging callbacks and guardrails was empty while /mcp-rest/tools/call exposed the full set. Rebuild the synthetic request from the connection's raw headers (shared with the sampling path), and pass sanitized headers to the pre-call hook, the MCP to LLM guardrail bridge and the Responses API MCP bridge. Credential headers stay masked and proxy key headers stripped. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(mcp): strip custom proxy key and upstream MCP credential headers from logging copies Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(mcp): make client side auth header name accessor public Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(mcp): strip custom proxy key and client redaction opt-out from mcp headers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(mcp): drop custom proxy key header in the synthetic request builder Strips general_settings.litellm_key_header_name in build_synthetic_mcp_request so every caller, including sampling, is covered, and reverts passing general_settings into add_litellm_data_to_request on the tool call path since that also switches on enforced_params. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: shivam <shivam@berri.ai>
A deployment with PTU flat-cost attribution also billed every request per
token, so a team paid for reserved capacity and again for the traffic that
capacity serves. Nothing set the per-token price and an unset price falls
back to the public cost map, which made the double charge the default.
/model/new and /model/{id}/update now store zero for every pricing field the
cost map could otherwise fill, refuse a price the caller supplies alongside
PTU config with a 400 naming the field, zero a price already on the row
rather than rejecting later edits of unrelated fields, and drop the zeros
again when the PTU config goes.
A PTU deployment is no longer read as a free model by the budget checks,
which would have waived every budget for it.
… CheckBatchCost A managed batch whose request lines all failed can reach a terminal provider status (completed) with output_file_id=None and only an error_file_id. Such a row matched neither the completed-with-output billing branch nor the failed/expired/cancelled branch, so batch_processed stayed False and the poller re-selected it on every cycle for the lifetime of the deployment; output/error file deletion is also gated on batch_processed, so those files could never be deleted. Broaden the terminal handling so a completed/complete/expired batch with an output file is billed, and any terminal batch with nothing to bill (failed/cancelled, or completed/expired with no output) is marked terminal exactly once. Non-terminal statuses (validating/in_progress) are still left for the next poll, and an expired batch that did produce output is now billed. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
fix(ui): add nvidia riva to the model provider list
fix(scripts): end make check with a ran/skipped summary and verdict
* fix(proxy): track spend for OpenAI passthrough /v1/embeddings OpenAI passthrough embeddings returned 200 but wrote no spend because the route was unsupported and Cohere's /v1/embed prefix stole the match. * fix(proxy): clear embeddings lint and Greptile comment nits Inline embeddings cost tracking to avoid new LIT001/002 hits, trim redundant doc comments, and cover the Cohere /v1/embeddings collision. * fix(proxy): drop unreachable embeddings TypeError guard convert_to_model_response_object with response_type=embedding already returns EmbeddingResponse; the isinstance check was dead patch coverage.
…itellm_lit002_typeddict_dict_literals # Conflicts: # type-discipline-budget.json
request_id is the primary key of LiteLLM_SpendLogs and the flush inserts with
skip_duplicates, so a spend log whose id already exists is dropped with no error
raised and a "processed 1 spend log" line still logged. Batch cost accounting
produced exactly such an id twice over, and on a proxy with message redaction
enabled no batch cost row could be written at all.
get_spend_logs_id derived the id by md5-hashing the response for two call types,
aretrieve_batch and acreate_file. Redaction makes that hash a constant:
perform_redaction returns the fixed {"text": "redacted-by-litellm"} placeholder
for any shape it cannot redact, which is what a batch object and a file body both
become, so every such row hashed to md5('{"text": "redacted-by-litellm"}') =
00fcbef15a3b0097e14b0ca016ed30a0 regardless of provider, user, or amount. The
first row to claim that id owned it and every later row was discarded. Verified
against a live proxy: four payloads spanning two providers and three distinct
spend values all computed that id, and the table held one acreate_file row dating
to 2025-05-25, the row that had claimed it.
Keying off the batch's own identity instead is necessary but not sufficient,
because creating a batch already writes an acreate_batch row under exactly that
id, so the cost row becomes a duplicate of the batch's own creation row. Also
verified live: after the hash was removed the poller computed and flushed a
batch's cost, and the only row carrying that id was the acreate_batch row from
when the batch was submitted.
The id now comes from the response's own id, then the standard logging payload's
id, then litellm_call_id, and a batch cost row is namespaced with a _batch_cost
suffix so it cannot collide with the creation row. The middle term is what keeps
this correct under redaction: that payload is built from the unredacted response,
so it still carries the batch id after redaction has flattened the body. Keying
the cost row to the batch rather than to the call also keeps accounting the same
batch twice collapsing to one row instead of billing it twice. Every other call
type still derives its key exactly as before.
Cost and usage themselves are unaffected by redaction: the token columns fall back
to the standard logging payload and spend comes from its response_cost, neither of
which redaction touches. generate_hash_from_response had no other caller and is
removed with it.
…uted and cost-poller paths get_configured_s3_bucket_name accepts the output bucket only from the immutable _litellm_internal_model_credentials snapshot or AWS_S3_BUCKET_NAME. That refusal to read litellm_params is deliberate: the bucket is what validate_managed_cloud_file_id checks a file id against, so trusting a request-supplied value would let a caller redirect reads to a bucket of their choosing Two live entry points reach the Bedrock file-content transformation without ever building that snapshot. The managed-files pre-call hook sets data["model"] for any id carrying llm_output_file_id, which is every batch output, so get_file_content always takes the model-routed branch; that branch called llm_router.afile_content directly, and managed_files_obj.afile_content, the only caller that built the snapshot, is therefore unreachable for batch output. CheckBatchCost spread the deployment credentials as plain kwargs, and get_litellm_params does not carry s3_bucket_name across (gcs_bucket_name is listed for exactly this reason, its S3 counterpart is not), so the poller lost the bucket the same way The result was that every completed Bedrock managed batch failed files.content with "S3 bucket_name is required" and never had its cost tracked, leaving the row to be re-polled every cycle. Both paths now resolve the deployment credentials and pass the same MappingProxyType snapshot the managed-files hook already builds
The mock merged every call into one shared dict, so a second routed retrieval would overwrite the first and the assertions would still pass. Keep one frozen snapshot per call and assert exactly one call, which also makes an unintended second retrieval a failure rather than something the merge hides
…ccounting path too A third path reads a completed batch's output file, and it could not resolve the bucket either. When cost is accounted from the retrieve itself rather than from the poller, the batch success handler calls _handle_completed_batch, which fetches the output file through _extract_file_access_credentials. That helper forwarded a whitelist covering Azure and Vertex, gcs_bucket_name included, but nothing for Bedrock, and retrieve_batch built its litellm_params through get_litellm_params, whose fixed signature drops the trusted credential snapshot. So the snapshot never reached the file read and it failed with "S3 bucket_name is required" for a bucket the deployment had configured, leaving the batch's cost unrecorded. Adding s3_bucket_name to that whitelist would not have worked. The Bedrock file config deliberately resolves the bucket only from the immutable server-side snapshot or the environment, never from a request param, because the bucket is what managed file ids are validated against. The snapshot is therefore what has to flow, exactly as it already does for the model-routed and cost-poller paths. retrieve_batch now re-adds the snapshot after get_litellm_params, the same way the file operations already do, the whitelist forwards it, and the proxy attaches it for router-routed managed batches from the deployment behind the unified id. Verified against a live proxy reading a real completed Bedrock batch: the cost row appears within seconds of the retrieve carrying the batch's real spend and usage, where before the read raised and no row was written. Resolving those credentials is best effort. A batch whose deployment no longer resolves, which happens when a model group is removed while batches are in flight, still serves its status instead of failing the request on the lookup. This matters for the OSS and polling-disabled configurations, where the retrieve path is the only thing that accounts for a batch at all.
…all paths The helper that carries the credential snapshot into litellm_params lived private in files/main.py, and the batch retrieve needed it too. It now sits beside get_litellm_params, which is what it augments, so neither caller reaches into the other's private surface. Typed as Mapping/MutableMapping of object rather than Any, which the strict import rules ban. The file-content route builds the snapshot through the same helper as the batch route instead of assembling a conditional mapping inline, which drops two mutable constructions and leaves one way to attach it. Its name loses the batch suffix now that both routes use it.
Two components computed a managed batch's cost and each assumed it was the only one. Retrieving a batch computed it through the @client decorator's success callback, and CheckBatchCost computed it on its own schedule. Whichever observed completion first decided the outcome, so cost was either counted once per retrieve or not at all. The lockout is the worse half. Retrieving a batch that had reached completion set batch_processed=True, which is what takes a batch out of CheckBatchCost's queue, since it selects batch_processed=False. That write claimed the cost had been accounted for on behalf of a callback that had not run yet and was not awaited. When the callback then failed the cost was gone permanently, with the poller already retired and no retry left. Observed on a live proxy: two completed batches whose callbacks raised inside the logging worker, one on a provider output path that did not resolve and one on a batch whose output file id was still None, both left marked processed with no spend row and no way to recover them. Nothing logged at error level for the batches themselves. The over-count is the other half. Nothing suppressed recomputation, so each retrieve of an already-completed batch recorded that batch's full cost again. A caller polling its own batch to see whether it had finished inflated spend by however many times it looked. The flag now means what its name says, and only the component that actually recorded the cost sets it. When the poller is running it owns accounting, so retrieving a managed batch records no cost and leaves the flag alone; the poller computes once and sets it. When the poller cannot be relied on, either because polling is disabled by config or because the enterprise job never registered, the retrieve path is the only accountant and behaves exactly as before. Batches with no managed object row are untouched either way, since neither the flag nor the poller queue applies to them.
…ches done The handoff asked whether the poller was running, when what matters is whether it will actually account for the batch. Those differ on a schema without the batch_processed column: the poller cannot filter on it, so it falls back to a query that excludes complete and completed rows, and it cannot set it either. A caller retrieving a provider-completed batch before the poller saw it therefore suppressed inline accounting, then marked the row complete, and the fallback query could never find it again. Nobody accounted for that batch, so its cost escaped the caller's budget entirely. The poller now publishes batch_processed_support_confirmed, set only once a filtered query has actually succeeded, and the handoff requires it. Defaulting to unconfirmed keeps accounting on the retrieve path in exactly the cases the poller would drop the batch, including the window before the poller's first cycle. All four combinations account exactly once: unconfirmed leaves the retrieve accounting and setting the marker, whether or not the column exists, and confirmed is only reachable when the column is present, where the poller accounts and sets it. A scheduler that hands back something other than a bound method leaves no poller to interrogate, which reads as unconfirmed rather than as working.
The ownership question was asked twice for one retrieve: once before the provider call to decide whether to suppress inline accounting, and again afterwards to decide whether to mark the batch accounted. Between those two points the poller can complete its first successful filtered query and become usable, so the two answers disagree. The retrieve then accounts for the batch inline, having decided the poller was unusable, while the later check sees a usable poller and leaves the marker unset, so the poller accounts for the same batch again and its spend is counted twice. The retrieve now decides once and passes that decision to update_batch_in_database, which prefers it over re-deriving one. Callers that record no cost of their own leave it unset and keep deriving it as before, so the cancel path is unchanged.
…itellm_/remove-test-migrate-gha-d1eae8
Both are covered on GitHub Actions. test-litellm-ui-build.yml runs the dashboard build on every PR, and test-litellm-ui-unit.yml runs the vitest suite with ui-unit-tests already a required check, so neither CircleCI job gates anything that GHA does not already gate. ui_build additionally produced nothing anyone consumed. It persisted litellm/proxy/_experimental/out to the workspace, and the only job downstream of it was ui_unit_tests, which never attached the workspace and reinstalled from source instead. The requires edge was pure sequencing, so the build output was written and discarded on every client-touching PR. One real narrowing comes with this, and it is deliberate. ui_unit_tests ran the full vitest suite on PRs, while the GHA job scopes PR runs to tests reachable from the diff and keeps the full suite on pushes to staging. That split was a measured decision in #34175 and it still holds: the suite is 252s and 248s of that is CreateMCPServer.integration.test.tsx alone, so running everything per PR buys about four minutes to re-run one file. Note that assert-ci-coverage does not speak to this. It walks tests/**/test_*.py only, so it is blind to vitest files by construction; it stays green here because no Python test lost a runner, which is a narrower claim than the UI side being unaffected. auth_ui_unit_tests is a different job, a Python suite on a Postgres sidecar, and is untouched
…ayload (#36744) Request metadata carries the whole UserAPIKeyAuth object, whose team_metadata holds the customer's own langfuse callback_vars. The only filter on the emitted blob was a four key deny list written as a circular reference crash guard, so those credentials reached the customer's own langfuse traces. The emitted blob is now the StandardLoggingPayload allowlist plus the litellm computed enrichments, and nothing is copied across from raw request metadata. That makes the credential exclusion structural rather than a filter someone has to keep correct. Steering keys keep reading raw metadata, matching literal_ai. Proxy callers are unaffected: their request metadata already rides under the allowlisted requester_metadata key, nesting intact. debug_langfuse dumped raw request metadata into the trace as a second copy of the same leak. It now emits caller scalars only. When StandardLoggingPayload is absent the trace is still emitted with the existing trace_id fallback, so failure traces survive.
Replaces Ant Design with the in-repo shadcn layer across every Navbar component, removing the last antd imports from src/components/Navbar. - CommunityEngagementButtons, NotificationsBell, ViewSwitcher, BlogDropdown, WorkerDropdown and UserDropdown now compose @/components/ui primitives - antd icons render at 1em while lucide defaults to 24px, so every icon carries an explicit size class matching what it replaced - UserDropdown uses Popover rather than DropdownMenu: its panel holds switches and badges, and form controls inside role="menu" are invalid - WorkerDropdown moves to Combobox since shadcn Select has no search - drops the nine no-restricted-imports suppressions these files no longer need
Replaces Ant Design across every source file under src/components/view_logs, so the request log drawer and its viewers compose @/components/ui primitives. - Drawer becomes Sheet, Collapse becomes Collapsible, Segmented and Radio.Group become Tabs, Tag becomes Badge, Descriptions becomes a local grid helper - every lucide icon carries an explicit size class, since antd icons render at 1em while lucide defaults to 24px - two tests dropped assertions on antd internal class names in favour of rendered text and roles, and the Pretty/JSON case now proves the toggle actually swaps the body rather than only that both controls render - drops the eslint suppressions these files no longer need
## TLDR Signed-off-by: Ishaan <ishaangupta0408@gmail.com>
…oding fix(passthrough): stop forwarding client Accept-Encoding upstream
…itellm_/circleci-pipeline-triage-9b92e5
…itellm_batch_cost_accounted_once # Conflicts: # tests/test_litellm/proxy/openai_files_endpoint/test_files_common_utils.py
| try: | ||
| if prisma is None: | ||
| return | ||
| if await _key_or_team_is_over_budget(parent_metadata): |
There was a problem hiding this comment.
Medium: Concurrent shadow calls bypass budget reservation
This check only reads current spend; it does not atomically reserve the estimated cost of the shadow and judge calls. A user can issue enough qualifying requests concurrently for up to 16 pipelines per pod to pass against the same pre-update balance, then consume provider funds beyond the key or team budget. Reserve the combined maximum cost before dispatch and reconcile it with the actual shadow and judge costs, as the normal authenticated request path does.
| if at_head | ||
| else tuple(prisma_client.spend_log_transactions) + tuple(logs) | ||
| ) | ||
| kept, kept_bytes = spend_log_queue_within_budget(queued, PrismaClient.spend_log_queue_bytes + added, max_bytes) |
There was a problem hiding this comment.
Low: Spend-log eviction by authenticated callers
An authenticated caller can submit enough prompt-heavy requests to exceed this shared 64 MB queue budget, causing the oldest pending spend and request records—including other tenants' records—to be discarded before reaching the database. A single oversized newest row is always retained by spend_log_queue_within_budget, so it can evict the entire existing queue where request-size enforcement is unset; apply backpressure, reject the new record, or spill records to durable storage instead of silently deleting queued audit data.
| baseline_model String? // reverse only: the fixed model the router is judged against | ||
| judge_model String | ||
| shadow_percentage Float | ||
| max_turns Int // sample budget: judge at most this many turns |
There was a problem hiding this comment.
Low: Shadow-eval spend cap is not globally enforced
An authenticated user can exceed max_turns by sending parallel requests across multiple proxy pods: each pod admits work using its own cached attempt count and performs the billable shadow and judge calls before inserting an attempt. Add an atomic database claim before provider dispatch—such as a transactionally incremented reservation counter—and make (job_id, request_id) unique so retries cannot consume the budget twice.
| const grantsServerNamedBy = (permissionKey: string): boolean => { | ||
| const named = allServers.filter((candidate) => mcpServerMatchesIdentifier(candidate, permissionKey)); | ||
| if (named.length === 0) return true; | ||
| return named.some(grants); |
There was a problem hiding this comment.
Medium: Shared identifiers preserve access to deselected servers
An MCP name or alias can resolve to multiple servers. Keeping the original permission when only one match remains granted causes the backend to expand it back to every matching server; since tool-permission keys also grant server access, a key holder can continue calling a server the administrator deselected. Resolve retained permissions to the specific granted server IDs, rather than retaining the shared identifier when named.some(grants) is true.
PR overviewThis PR promotes internal staging changes to main, including updates to shadow-evaluation accounting, spend-log handling, and MCP server entitlement management. Four security issues remain open, with none addressed yet. The most significant issue can preserve access to MCP servers that an administrator deselected when server names or aliases overlap, while concurrency gaps can also allow authenticated users to exceed shadow-evaluation spending limits. Shared spend-log buffering may additionally let authenticated callers evict pending audit records across tenants. Open issues (4)
Fixed/addressed: 0 · PR risk: 7/10 |
Both providers reworded the error strings these two cells pinned, so the suite went red without any behavior changing. Anthropic's auth error is now "API key is invalid." rather than "invalid x-api-key", and OpenAI rejects an empty upload with "This model does not support the format you provided.", which names neither "file" nor "audio". Assert the durable shape instead. The otel cell pins the machine-readable authentication_error type plus a non-empty message, and the embedded JSON still has to parse, which is what proves the attribute survived untruncated. The transcription cell pins that the 400 relays the provider's own rejection and is typed as a client input error, so a regression that swallows the provider reason or returns a 500 still fails.
This cell needs the websearch_interception callback and a declared search backend, both listed in its own module docstring. The ephemeral e2e stack ships neither, so the request falls through to the bedrock transformation and takes the by-design 400 that tells you to enable interception. The cell has never been green here: the error path merged about an hour and a half before the cell did, and the last full suite to pass predates the cell entirely. Skip it with the reason recorded so the run reports honestly instead of carrying a permanent red, and unskip once the stack ships the config the docstring already spells out.
fix(batches): account a managed batch's cost exactly once
…event (#37038) * fix(panw_prisma_airs): scan tool call args as plain text, not a tool_event Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(panw_prisma_airs): type the tool call argument extractor Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(panw_prisma_airs): cover tool call error fallback and dict masking paths Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(panw_prisma_airs): scan tool names with args and tolerate custom tool calls Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(panw_prisma_airs): scan tool call arguments that arrive already parsed The tool call slice types arguments as a string, so a client posting parsed JSON failed validation and the whole tool call, name included, read as unscannable and was skipped without ever reaching AIRS. The OpenAI request path forwards client-supplied tool_calls verbatim, so that shape is reachable. Coerce non-string arguments instead of rejecting them, so the content is scanned. * fix(panw_prisma_airs): route tool-block masked data by scan side, not by key name Merging #37036 (already on staging) with this PR produces no conflict and a silent bug. #37036 withholds prompt_masked_data on response-side tool blocks, which was right while tool calls went out as a request-side tool_event: AIRS reported the model's arguments under that key. This PR scans tool calls as ordinary prompt/response text, so the side of the scan now decides which key holds what. The model's arguments arrive under response_masked_data, already covered by _CLIENT_HIDDEN_SCAN_FIELDS, and prompt_masked_data goes back to being the caller's own input -- one of the audit fields LIT-5638 asks for. Left as merged, a response-side tool block drops that field with nothing to flag it. - Tool-path block branch calls _build_error_detail without also_hide - also_hide parameter removed; after this change it has no callers - Regression test asserts both directions: model output withheld, caller input preserved. It fails against the auto-merged combination. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(panw_prisma_airs): a wrong-typed tool name must not suppress the scan _ToolCallFunctionSlice types name as str, and _get_tool_call_function turns any ValidationError into (None, None), which _scan_tool_calls_for_guardrail reads as an unscannable tool call and skips. So a client posting "name": 123 keeps its arguments off the wire to AIRS entirely -- no error, no log, no block. The OpenAI request path forwards client tool_calls verbatim, so this is reachable by any caller holding a valid key. _coerce_arguments already existed for exactly this failure mode on the sibling field. Widening it to cover name closes the gap: name='transfer_funds' AIRS called: 1x args scanned: True name=123 (int) AIRS called: 0x args scanned: False <- before name=123 (int) AIRS called: 1x args scanned: True <- after Reported by Cursor Bugbot on fd9f639. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Yucheng Zhu <yucheng@berri.ai> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…literals feat(lint): exempt TypedDict-annotated dict literals from LIT002
…re/After with nested cases
docs(claude): tell agents to let heavy gates queue for machine-wide slots
…itellm_/nice-wilson-9fbed6
…age-9b92e5 test: unstick the suites CircleCI is failing on
docs(github): proof-of-fix section shows only the latest run as Before/After with nested cases
test(e2e): assert provider error shape instead of pinned prose
fix(ui): de-duplicate the reset budget option and polish shadcn surfaces
chore: rebuild Admin UI bundle from litellm_internal_staging
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,164668,e=>{"use strict";var t=e.i(717521);e.s(["LoaderCircle",()=>t.default])},62478,e=>{"use strict";var t=e.i(602869);let i=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,i])},592392,e=>{"use strict";var t=e.i(62478),i=e.i(266027);let a=(0,e.i(243652).createQueryKeys)("proxySettings"),r={PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null};e.s(["default",0,function(e){let{data:s}=(0,i.useQuery)({queryKey:[...a.all,e],queryFn:()=>(0,t.fetchProxySettings)(e),enabled:!!e});return s??r}])},283713,e=>{"use strict";var t=e.i(271645),i=e.i(602869),a=e.i(612256);let r="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,a.useUIConfig)(),s=e?.is_control_plane??!1,n=e?.workers??[],[o,l]=(0,t.useState)(()=>localStorage.getItem(r));(0,t.useEffect)(()=>{if(!o||0===n.length)return;let e=n.find(e=>e.worker_id===o);e&&(0,i.switchToWorkerUrl)(e.url)},[o,n]);let d=n.find(e=>e.worker_id===o)??null,c=(0,t.useCallback)(e=>{let t=n.find(t=>t.worker_id===e);t&&(l(e),localStorage.setItem(r,e),(0,i.switchToWorkerUrl)(t.url))},[n]);return{isControlPlane:s,workers:n,selectedWorkerId:o,selectedWorker:d,selectWorker:c,disconnectFromWorker:(0,t.useCallback)(()=>{l(null),localStorage.removeItem(r),(0,i.switchToWorkerUrl)(null)},[])}}])},251773,276701,771243,895335,e=>{"use strict";var t=e.i(843476),i=e.i(731565),a=e.i(602869),r=e.i(266027);async function s(){let e=(0,a.getProxyBaseUrl)(),t=await fetch(`${e}/public/litellm_blog_posts`);if(!t.ok)throw Error(`Failed to fetch blog posts: ${t.statusText}`);return t.json()}let n="inline-flex h-9 shrink-0 items-center justify-center gap-1 rounded-md px-2 text-sm font-medium leading-none text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-950";e.s(["NAV_PRODUCT_LINK_CLASS",0,n],276701);var o=e.i(519455),l=e.i(755146),d=e.i(664659),c=e.i(164668);e.s(["BlogDropdown",0,()=>{let e=(0,i.useDisableBlogPosts)(),{data:a,isLoading:p,isError:m,refetch:u}=(0,r.useQuery)({queryKey:["blogPosts"],queryFn:s,staleTime:36e5,retry:1,retryDelay:0});return e?null:(0,t.jsxs)(l.DropdownMenu,{modal:!1,children:[(0,t.jsxs)(l.DropdownMenuTrigger,{openOnHover:!0,closeDelay:100,render:(0,t.jsx)(o.Button,{variant:"ghost",className:`${n} border-0! bg-transparent!`}),children:["Blog",(0,t.jsx)(d.ChevronDown,{className:"size-2.5 text-gray-500","aria-hidden":!0})]}),(0,t.jsx)(l.DropdownMenuContent,{align:"end",side:"bottom",className:"w-auto",children:p?(0,t.jsx)("div",{className:"flex items-center px-2 py-1.5 text-sm",children:(0,t.jsx)(c.LoaderCircle,{role:"img","aria-label":"loading",className:"size-4 animate-spin"})}):m?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-sm",children:[(0,t.jsx)("span",{className:"text-destructive",children:"Failed to load posts"}),(0,t.jsx)(o.Button,{variant:"outline",size:"sm",onClick:()=>u(),children:"Retry"})]}):a&&0!==a.posts.length?(0,t.jsxs)(t.Fragment,{children:[a.posts.slice(0,5).map(e=>(0,t.jsx)(l.DropdownMenuItem,{children:(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",width:380},children:[(0,t.jsx)("h5",{className:"text-sm font-semibold",style:{marginBottom:2},children:e.title}),(0,t.jsx)("span",{className:"text-muted-foreground",style:{fontSize:11},children:new Date(e.date+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),(0,t.jsx)("p",{className:"line-clamp-2",children:e.description})]})},e.url)),(0,t.jsx)(l.DropdownMenuSeparator,{}),(0,t.jsx)(l.DropdownMenuItem,{children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/blog",target:"_blank",rel:"noopener noreferrer",children:"View all posts"})})]}):(0,t.jsx)("div",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No posts available"})})]})}],251773);var p=e.i(636772);e.i(176782),e.i(911825);var m=e.i(115504);e.i(772436);let u=(0,m.cva)({base:"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",variants:{orientation:{horizontal:"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",vertical:"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"}},defaultVariants:{orientation:"horizontal"}});function g({className:e,orientation:i,...a}){return(0,t.jsx)("div",{role:"group","data-slot":"button-group","data-orientation":i,className:(0,m.cn)(u({orientation:i}),e),...a})}var h=e.i(746798),f=e.i(475254);let x=(0,f.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),b=[{href:"https://www.litellm.ai/support",label:"Join Slack",tooltip:"LiteLLM Slack community",Icon:(0,f.default)("slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]])},{href:"https://github.com/BerriAI/litellm",label:"LiteLLM on GitHub",tooltip:"LiteLLM on GitHub",Icon:x}];e.s(["CommunityEngagementButtons",0,()=>(0,p.useDisableShowPrompts)()?null:(0,t.jsx)(h.TooltipProvider,{children:(0,t.jsx)(g,{"aria-label":"Community links",children:b.map(({href:e,label:i,tooltip:a,Icon:r})=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":i,className:(0,m.cn)((0,o.buttonVariants)({variant:"outline",size:"icon"}),"text-muted-foreground")}),children:(0,t.jsx)(r,{})}),(0,t.jsx)(h.TooltipContent,{children:a})]},e))})})],771243);var _=e.i(271645),y=e.i(115571);let j="litellmHideAutoRouterAnnouncement";function w(e){let t=t=>{t.key===j&&e()},i=t=>{let{key:i}=t.detail;i===j&&e()};return window.addEventListener("storage",t),window.addEventListener(y.LOCAL_STORAGE_EVENT,i),()=>{window.removeEventListener("storage",t),window.removeEventListener(y.LOCAL_STORAGE_EVENT,i)}}function v(){return"true"===(0,y.getLocalStorageItem)(j)}var k=e.i(487486),N=e.i(337822),S=e.i(245423);e.s(["NotificationsBell",0,()=>{let e=!(0,_.useSyncExternalStore)(w,v),[i,a]=(0,_.useState)(!1),r=(0,t.jsxs)("div",{className:"max-w-[280px]",children:[(0,t.jsx)(N.PopoverTitle,{className:"mt-0! mb-2!",children:"LiteLLM Auto Router"}),(0,t.jsx)(N.PopoverDescription,{className:"mb-3! text-sm leading-snug",children:"Route every request to the cheapest model that can handle it, no prompt changes needed."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("a",{className:(0,m.cn)((0,o.buttonVariants)({size:"sm"})),href:"https://docs.litellm.ai/docs/proxy/auto_routing",target:"_blank",rel:"noopener noreferrer",children:"Read the docs"}),e?(0,t.jsx)(o.Button,{variant:"link",size:"sm",className:"px-1!",onClick:()=>{(0,y.setLocalStorageItem)(j,"true"),(0,y.emitLocalStorageChange)(j),a(!1)},children:"Mark as read"}):null]})]});return(0,t.jsxs)(N.Popover,{open:i,onOpenChange:a,children:[(0,t.jsx)(N.PopoverTrigger,{className:"flex! h-9! w-9! items-center justify-center rounded-md! text-gray-600 transition-colors hover:bg-gray-100! hover:text-gray-900!","aria-label":"Notifications",children:(0,t.jsxs)("span",{className:"relative inline-flex",children:[(0,t.jsx)(S.Bell,{className:"size-4","aria-hidden":!0}),e?(0,t.jsx)(k.Badge,{className:"absolute -top-0.5 -right-1 size-1.5 p-0","aria-hidden":!0}):null]})}),(0,t.jsx)(N.PopoverContent,{align:"end",children:r})]})}],895335)},641141,e=>{"use strict";var t=e.i(843476),i=e.i(135214),a=e.i(731565),r=e.i(912089),s=e.i(636772),n=e.i(115571),o=e.i(222038),l=e.i(664659),d=e.i(344523),c=e.i(243553),p=e.i(292270),m=e.i(263488),u=e.i(581418),g=e.i(284614),h=e.i(799676),f=e.i(487486),x=e.i(337822),b=e.i(772436),_=e.i(699375),y=e.i(746798),j=e.i(922407),w=e.i(115504),v=e.i(271645);e.s(["default",0,({onLogout:e,variant:k="navbar",collapsed:N=!1})=>{let{userId:S,userEmail:C,userRoleLabel:I,premiumUser:L}=(0,i.default)(),A=(0,s.useDisableShowPrompts)(),z=(0,a.useDisableBlogPosts)(),$=(0,r.useDisableBouncingIcon)(),[E,T]=(0,v.useState)(!1);(0,v.useEffect)(()=>{T("true"===(0,n.getLocalStorageItem)("disableShowNewBadge"))},[]);let P=C||S||"user",B=function(e,t){let i=e?.split("@")[0]?.trim();if(i){let e=i.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);if(e.length>=2)return`${e[0].charAt(0)}${e[1].charAt(0)}`.toUpperCase();if(1===e.length){let t=e[0];return t.length>=2?t.slice(0,2).toUpperCase():`${t.charAt(0)}`.toUpperCase()}}return t&&t.length>=2?t.slice(0,2).toUpperCase():t&&1===t.length?`${t.toUpperCase()}•`:"?"}(C,S),O=function(e){let t=0;for(let i=0;i<e.length;i+=1)t=e.charCodeAt(i)+((t<<5)-t);return Math.abs(t)%360}(P),D=(0,o.navAccountDisplayName)(C,S);return(0,t.jsxs)(x.Popover,{children:["sidebar"===k?(0,t.jsxs)(x.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:(0,w.cn)("flex w-full items-center rounded-lg border border-transparent transition-colors hover:bg-sidebar-accent",N?"justify-center px-0 py-1":"gap-2.5 px-2 py-1.5 text-left"),"aria-label":`Account menu — ${I??"Unknown role"} — signed in as ${C||S||"unknown"}`,"aria-haspopup":"dialog",title:N?D:void 0}),children:[(0,t.jsx)(h.Avatar,{className:"size-[30px] shadow-inner ring-1 ring-black/5","aria-hidden":!0,children:(0,t.jsx)(h.AvatarFallback,{className:"font-semibold text-white",style:{backgroundColor:`hsl(${O} 46% 38%)`},children:B})}),!N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsx)("span",{className:"block truncate text-[13px] font-medium text-sidebar-foreground",children:D}),I&&(0,t.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:I})]}),(0,t.jsx)(d.ChevronsUpDown,{size:16,strokeWidth:1.75,className:"shrink-0 text-muted-foreground","aria-hidden":!0})]})]}):(0,t.jsxs)(x.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex! max-w-[min(200px,34vw)] items-center gap-2 rounded-md! py-0.5! pl-1! pr-2! transition-colors hover:bg-gray-100!","aria-label":`Account menu — ${I??"Unknown role"} — signed in as ${C||S||"unknown"}`,"aria-haspopup":"dialog"}),children:[(0,t.jsx)(h.Avatar,{className:"shadow-inner ring-1 ring-black/5","aria-hidden":!0,children:(0,t.jsx)(h.AvatarFallback,{className:"font-semibold text-white",style:{backgroundColor:`hsl(${O} 46% 38%)`},children:B})}),(0,t.jsx)("span",{className:"hidden min-w-0 truncate text-left text-sm font-medium leading-none text-gray-900 md:inline",children:D}),(0,t.jsx)(l.ChevronDown,{className:"hidden size-2.5 shrink-0 text-gray-400 md:inline","aria-hidden":!0})]}),(0,t.jsxs)(x.PopoverContent,{align:"sidebar"===k?"start":"end",side:"sidebar"===k?"top":"bottom",className:"w-auto gap-0 rounded-lg bg-white p-1 shadow-lg","data-testid":"user-dropdown-panel",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 p-3 text-sm",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.Mail,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:C||"-"})]}),L?(0,t.jsxs)(f.Badge,{children:[(0,t.jsx)(c.Crown,{className:"size-3"}),"Premium"]}):(0,t.jsx)(y.TooltipProvider,{children:(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsxs)(y.TooltipTrigger,{render:(0,t.jsx)(f.Badge,{variant:"outline"}),children:[(0,t.jsx)(c.Crown,{className:"size-3"}),"Standard"]}),(0,t.jsx)(y.TooltipContent,{side:"left",children:"Upgrade to Premium for advanced features"})]})})]}),(0,t.jsx)(b.Separator,{className:"my-2"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.User,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"User ID"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"max-w-[150px] truncate",title:S||"-",children:S||"-"}),(0,t.jsx)(j.default,{value:S,label:"Copy User ID"})]})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.ShieldCheck,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Role"})]}),(0,t.jsx)("span",{children:I})]}),(0,t.jsx)(b.Separator,{className:"my-2"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide New Feature Indicators"}),(0,t.jsx)(_.Switch,{size:"sm",checked:E,onCheckedChange:e=>{T(e),e?(0,n.setLocalStorageItem)("disableShowNewBadge","true"):(0,n.removeLocalStorageItem)("disableShowNewBadge"),(0,n.emitLocalStorageChange)("disableShowNewBadge")},"aria-label":"Toggle hide new feature indicators"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide All Prompts"}),(0,t.jsx)(_.Switch,{size:"sm",checked:A,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableShowPrompts","true"):(0,n.removeLocalStorageItem)("disableShowPrompts"),(0,n.emitLocalStorageChange)("disableShowPrompts")},"aria-label":"Toggle hide all prompts"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide Blog Posts"}),(0,t.jsx)(_.Switch,{size:"sm",checked:z,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableBlogPosts","true"):(0,n.removeLocalStorageItem)("disableBlogPosts"),(0,n.emitLocalStorageChange)("disableBlogPosts")},"aria-label":"Toggle hide blog posts"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide Bouncing Icon"}),(0,t.jsx)(_.Switch,{size:"sm",checked:$,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableBouncingIcon","true"):(0,n.removeLocalStorageItem)("disableBouncingIcon"),(0,n.emitLocalStorageChange)("disableBouncingIcon")},"aria-label":"Toggle hide bouncing icon"})]})]}),(0,t.jsx)(b.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:e,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",children:[(0,t.jsx)(p.LogOut,{className:"size-4"}),"Logout"]})]})]})}])},853295,658140,383862,e=>{"use strict";var t=e.i(843476),i=e.i(618566),a=e.i(755146),r=e.i(643531),s=e.i(344523),n=e.i(373264),o=e.i(271645),l=e.i(431703),d=e.i(602869);let c=(0,o.createContext)({mode:"ai-gateway",setMode:()=>{},plugins:[],activePlugin:null}),p="litellm_plugin_mode",m=(0,l.createApiClient)({getBaseUrl:()=>(0,d.getProxyBaseUrl)()??""});function u(){return localStorage.getItem(p)??"ai-gateway"}function g(){return(0,o.useContext)(c)}e.s(["PluginModeProvider",0,function({children:e,accessToken:i}){let[a,r]=(0,o.useState)(u),[s,n]=(0,o.useState)([]),[l,d]=(0,o.useState)(!1);(0,o.useEffect)(()=>{i&&m.get("/api/plugins",{accessToken:i}).then(e=>{n(Array.isArray(e)?e:[])}).catch(()=>{}).finally(()=>d(!0))},[i]);let g="ai-gateway"!==a&&l&&!s.some(e=>e.name===a)?"ai-gateway":a,h=s.find(e=>e.name===g)??null;return(0,t.jsx)(c.Provider,{value:{mode:g,setMode:e=>{r(e),localStorage.setItem(p,e)},plugins:s,activePlugin:h},children:e})},"usePluginMode",0,g],658140);var h=e.i(292639),f=e.i(571353);let x="chat";e.s(["default",0,function(){let{mode:e,setMode:o,plugins:l}=g(),{data:d}=(0,h.useUISettings)(),c=(0,i.usePathname)(),p=!!d?.values?.enable_chat_ui,m=(0,f.migratedHref)(x),u=(c??"").replace(/\/+$/,""),b=p&&(u===m||u.startsWith(`${m}/`)),_=b?"Chat":l.find(t=>t.name===e)?.display_name??"AI Gateway",y=[{key:"ai-gateway",label:"AI Gateway"},...l.map(e=>({key:e.name,label:e.display_name}))],j=p?{key:x,label:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-6 py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:"Chat"}),b&&(0,t.jsx)(r.Check,{className:"size-4 text-blue-600"})]}),onClick:()=>window.location.assign((0,f.migratedHref)(x))}:{key:x,disabled:!0,label:(0,t.jsxs)("div",{className:"flex max-w-[220px] flex-col py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:"Chat"}),(0,t.jsx)("span",{className:"whitespace-normal text-xs leading-snug text-muted-foreground",children:"Admins can enable in Settings"})]})},w=[...y.map(i=>({key:i.key,label:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-6 py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:i.label}),!b&&i.key===e&&(0,t.jsx)(r.Check,{className:"size-4 text-blue-600"})]}),onClick:()=>{o(i.key),b&&window.location.assign((0,f.migratedHref)(""))}})),j];return(0,t.jsxs)(a.DropdownMenu,{children:[(0,t.jsxs)(a.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex h-8 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background pl-1.5 pr-2 text-sm font-medium text-foreground transition-colors hover:bg-accent"}),children:[(0,t.jsx)("span",{className:"flex size-5 flex-none items-center justify-center rounded bg-muted text-muted-foreground",children:(0,t.jsx)(n.LayoutGrid,{className:"size-[13px]"})}),(0,t.jsx)("span",{className:"truncate",children:_}),(0,t.jsx)(s.ChevronsUpDown,{className:"size-3.5 flex-none text-muted-foreground"})]}),(0,t.jsx)(a.DropdownMenuContent,{className:"w-auto",children:w.map(e=>(0,t.jsx)(a.DropdownMenuItem,{disabled:e.disabled,onClick:e.onClick,children:e.label},e.key))})]})}],853295);var b=e.i(618393),_=e.i(131792),y=e.i(950594),j=e.i(283713);e.s(["default",0,({onWorkerSwitch:e})=>{let{isControlPlane:i,selectedWorker:a,workers:r}=(0,j.useWorker)();if(!i||!a)return null;let s=r.map(e=>({label:e.name,value:e.worker_id,disabled:e.worker_id===a.worker_id}));return(0,t.jsxs)(_.Combobox,{items:s,value:s.find(e=>e.value===a.worker_id)??null,itemToStringLabel:e=>e.label,onValueChange:t=>{t&&e(t.value)},children:[(0,t.jsx)(_.ComboboxInput,{className:"min-w-[180px]","aria-label":"Worker",children:(0,t.jsx)(y.InputGroupAddon,{align:"inline-start",children:(0,t.jsx)(b.Server,{className:"size-4"})})}),(0,t.jsxs)(_.ComboboxContent,{children:[(0,t.jsx)(_.ComboboxEmpty,{children:"No matching workers"}),(0,t.jsx)(_.ComboboxList,{children:e=>(0,t.jsx)(_.ComboboxItem,{value:e,disabled:e.disabled,children:e.label},e.value)})]})]})}],383862)},402874,e=>{"use strict";var t=e.i(843476),i=e.i(143488),a=e.i(912089),r=e.i(636772),s=e.i(283713),n=e.i(602869),o=e.i(571353),l=e.i(275144),d=e.i(268004),c=e.i(321836),p=e.i(592392),m=e.i(487486),u=e.i(664659),g=e.i(972518),h=e.i(799647),f=e.i(522016),x=e.i(251773),b=e.i(771243),_=e.i(276701),y=e.i(895335),j=e.i(641141),w=e.i(853295),v=e.i(383862);e.s(["default",0,({accessToken:e,isPublicPage:k=!1,sidebarCollapsed:N=!1,onToggleSidebar:S})=>{let C=(0,n.getProxyBaseUrl)(),I=(0,p.default)(e),{logoUrl:L}=(0,l.useTheme)(),{data:A}=(0,i.useHealthReadinessDetails)(e),z=A?.litellm_version,$=(0,a.useDisableBouncingIcon)(),E=(0,r.useDisableShowPrompts)(),{isControlPlane:T,selectedWorker:P}=(0,s.useWorker)(),B=T&&null!==P,O=L||`${C}/get_image`;return(0,t.jsx)("nav",{className:"sticky top-0 z-10 border-b border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"flex h-14 items-center px-4",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center",children:[S&&(0,t.jsx)("button",{onClick:S,className:"mr-2 flex h-9 w-9 items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900",title:N?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("span",{className:"text-lg",children:N?(0,t.jsx)(h.PanelLeftOpen,{className:"size-[18px]"}):(0,t.jsx)(g.PanelLeftClose,{className:"size-[18px]"})})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f.default,{href:(0,o.migratedHref)(""),className:"flex items-center",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"flex h-10 max-w-48 items-center justify-center overflow-hidden",children:(0,t.jsx)("img",{src:O,alt:"LiteLLM Brand",className:"h-auto max-h-full w-auto max-w-full object-contain"})})})}),z&&(0,t.jsxs)("div",{className:"relative",children:[!$&&(0,t.jsx)("span",{className:"absolute -left-2 -top-1 animate-bounce text-lg",style:{animationDuration:"2s"},title:"Thanks for using LiteLLM!",children:"🌑"}),(0,t.jsx)(m.Badge,{variant:"outline",className:"relative z-10 cursor-pointer text-xs font-medium",children:(0,t.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"shrink-0",children:["v",z]})})]})]})]}),!k&&(0,t.jsx)("div",{className:"ml-4 flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsx)(w.default,{})}),(0,t.jsxs)("div",{className:"ml-auto flex min-w-0 flex-1 items-center justify-end gap-4",children:[B&&(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(v.default,{onWorkerSwitch:e=>{(0,d.clearTokenCookies)(),(0,c.clearStoredReturnUrl)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=`${(0,c.getLoginUrl)()}?worker=${encodeURIComponent(e)}`}})}),(0,t.jsxs)("nav",{"aria-label":"Product documentation",className:`flex min-w-0 items-center gap-2 ${B?"border-l border-gray-200 pl-4":""}`,children:[(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:_.NAV_PRODUCT_LINK_CLASS,children:["Docs",(0,t.jsx)(u.ChevronDown,{className:"pointer-events-none size-2.5 opacity-0","aria-hidden":!0})]}),(0,t.jsx)(x.BlogDropdown,{})]}),!E&&(0,t.jsx)("div",{className:"flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsx)(b.CommunityEngagementButtons,{})}),!k&&(0,t.jsx)("div",{className:"flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-lg bg-gray-50 px-1 py-0 transition-colors hover:bg-gray-100",children:[(0,t.jsx)(y.NotificationsBell,{}),(0,t.jsx)("span",{className:"mx-0.5 h-6 w-px shrink-0 bg-gray-200","aria-hidden":!0}),(0,t.jsx)(j.default,{onLogout:()=>{(0,d.clearTokenCookies)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=I.PROXY_LOGOUT_URL||""}})]})})]})]})})})}])},652272,209261,e=>{"use strict";var t=e.i(843476),i=e.i(271645),a=e.i(447566),r=e.i(166406),s=e.i(492030),n=e.i(596239);let o=/^[a-zA-Z0-9][a-zA-Z0-9._-]*(\/[a-zA-Z0-9][a-zA-Z0-9._-]*)*$/,l=e=>e.trim().replace(/\/+$/,""),d=/\.(md|markdown|txt|json|ya?ml|toml)$/i,c=/^\d{1,3}(\.\d{1,3}){3}$/,p=/^[A-Za-z0-9-]+$/,m=/^[A-Za-z0-9._-]+$/,u=e=>e.pathname.split("/").filter(e=>""!==e),g=e=>{let t=e.split("/").filter(e=>""!==e);return t[t.length-1]??""},h=e=>e.toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""),f=e=>JSON.stringify({extraKnownMarketplaces:{"my-org":{source:{source:"url",url:`${e}/claude-code/marketplace.json`}}}},null,2),x=e=>{let{source:t}=e;return"github"===t.source&&t.repo?`/plugin marketplace add ${t.repo}`:("url"===t.source||"git-subdir"===t.source)&&t.url?`/plugin marketplace add ${t.url}`:`/plugin marketplace add ${e.name}`};e.s(["buildMarketplaceSettingsSnippet",0,f,"formatInstallCommand",0,x,"getCategoryBadgeColor",0,e=>{if(!e)return"gray";let t=e.toLowerCase();if(t.includes("development")||t.includes("dev"))return"blue";if(t.includes("productivity")||t.includes("workflow"))return"green";if(t.includes("learning")||t.includes("education"))return"purple";if(t.includes("security")||t.includes("safety"))return"red";if(t.includes("data")||t.includes("analytics"))return"orange";else if(t.includes("integration")||t.includes("api"))return"yellow";return"gray"},"isValidEmail",0,e=>!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),"isValidSemanticVersion",0,e=>!e||/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(e),"isValidSubPath",0,e=>{let t=l(e);return""!==t&&o.test(t)},"isValidUrl",0,e=>{if(!e)return!0;try{return new URL(e),!0}catch{return!1}},"parseKeywords",0,e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>""!==e):[],"parseSkillSource",0,(e,t)=>{let i=(e=>{let t,i=e.trim();if(""===i||i.startsWith("//"))return null;let a=/^[a-z][a-z0-9+.-]*:\/\//i.test(i)?i:`https://${i}`;try{t=new URL(a)}catch{return null}return"https:"!==t.protocol||""!==t.username||""!==t.password||!t.hostname.includes(".")||t.hostname.startsWith("[")||c.test(t.hostname)?null:t})(e);if(!i)return null;if("github.com"===i.hostname.replace(/^www\./,""))return((e,t)=>{let i=u(e);if(i.length<2)return null;let a=i[0],r=i[1].replace(/\.git$/,"");if(!p.test(a)||!m.test(r))return null;let s=`${a}/${r}`,n=`https://github.com/${s}`,c={parsed:{source:"github",repo:s},label:`GitHub repo — ${s}`,suggestedName:h(r)};if(i.length>=4&&("tree"===i[2]||"blob"===i[2])){let e=i.slice(4),t=g(e.join("/")),a=d.test(t)?e.slice(0,-1):e;if(0===a.length)return c;let r=l(a.join("/"));return o.test(r)?{parsed:{source:"git-subdir",url:n,path:r},label:`GitHub subdir — ${s} @ ${r}`,suggestedName:h(g(r))}:null}if(2!==i.length)return null;let f=l(t??"");return""!==f?o.test(f)?{parsed:{source:"git-subdir",url:n,path:f},label:`GitHub subdir — ${s} @ ${f}`,suggestedName:h(g(f))}:null:c})(i,t);if(u(i).length<2)return null;let a=`${i.protocol}//${i.host}${i.pathname.replace(/\/+$/,"")}`,r=l(t??"");return""!==r?o.test(r)?{parsed:{source:"git-subdir",url:a,path:r},label:`Git subdir — ${a} @ ${r}`,suggestedName:h(g(r))}:null:{parsed:{source:"url",url:a},label:`Git repo — ${a}`,suggestedName:h(g(i.pathname).replace(/\.git$/,""))}},"validatePluginName",0,e=>!!e&&""!==e.trim()&&/^[a-z0-9-]+$/.test(e)],209261),e.s(["default",0,({skill:e,onBack:o})=>{let l,[d,c]=(0,i.useState)("overview"),[p,m]=(0,i.useState)(null),u=(e,t)=>{navigator.clipboard.writeText(e),m(t),setTimeout(()=>m(null),2e3)},g="github"===(l=e.source).source&&l.repo?`https://github.com/${l.repo}`:"git-subdir"===l.source&&l.url?l.path?`${l.url}/tree/main/${l.path}`:l.url:"url"===l.source&&l.url?l.url:null,h=x(e),b=f(window.location.origin),_=[...e.category?[{property:"Category",value:e.category}]:[],...e.domain?[{property:"Domain",value:e.domain}]:[],...e.namespace?[{property:"Namespace",value:e.namespace}]:[],...e.version?[{property:"Version",value:e.version}]:[],...e.author?.name?[{property:"Author",value:e.author.name}]:[],...e.created_at?[{property:"Added",value:new Date(e.created_at).toLocaleDateString()}]:[]];return(0,t.jsxs)("div",{style:{padding:"24px 32px 24px 0"},children:[(0,t.jsxs)("div",{onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(a.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:"Skills"})]}),(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name}),e.description&&(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"8px 0 0 0",lineHeight:1.6},children:e.description})]}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28,marginTop:24},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:[{key:"overview",label:"Overview"},{key:"usage",label:"How to Use"}].map(e=>(0,t.jsx)("div",{onClick:()=>c(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Skill Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Metadata registered with this skill"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:160},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:_.map((e,i)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},i))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Status"}),(0,t.jsx)("span",{style:{fontSize:12,padding:"3px 10px",borderRadius:12,backgroundColor:e.enabled?"#e6f4ea":"#f1f3f4",color:e.enabled?"#137333":"#5f6368",fontWeight:500},children:e.enabled?"Public":"Draft"})]}),g&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Source"}),(0,t.jsxs)("a",{href:g,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,color:"#1a73e8",wordBreak:"break-all",display:"flex",alignItems:"center",gap:4},children:[g.replace("https://",""),(0,t.jsx)(n.LinkOutlined,{style:{fontSize:11,flexShrink:0}})]})]}),e.keywords&&e.keywords.length>0&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.keywords.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Skill ID"}),(0,t.jsx)("div",{style:{fontSize:12,fontFamily:"monospace",color:"#3c4043",wordBreak:"break-all"},children:e.id})]})]})]}),"usage"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"Using this skill"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:"Once your proxy is set as a marketplace, enable this skill in Claude Code with one command:"}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden",marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"Run in Claude Code"}),(0,t.jsxs)("button",{onClick:()=>u(h,"install"),style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"install"===p?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["install"===p?(0,t.jsx)(s.CheckOutlined,{}):(0,t.jsx)(r.CopyOutlined,{}),"install"===p?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:14,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:h})]}),(0,t.jsxs)("p",{style:{fontSize:13,color:"#5f6368",lineHeight:1.6,margin:0},children:["Don't have the marketplace configured yet?"," ",(0,t.jsx)("span",{onClick:()=>c("setup"),style:{color:"#1a73e8",cursor:"pointer"},children:"See one-time setup →"})]})]}),"setup"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"One-time marketplace setup"}),(0,t.jsxs)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:["Add this to"," ",(0,t.jsx)("code",{style:{fontSize:13,backgroundColor:"#f1f3f4",padding:"1px 6px",borderRadius:4},children:"~/.claude/settings.json"})," ","to point Claude Code at your proxy:"]}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"~/.claude/settings.json"}),(0,t.jsxs)("button",{onClick:()=>u(b,"settings"),style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"settings"===p?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["settings"===p?(0,t.jsx)(s.CheckOutlined,{}):(0,t.jsx)(r.CopyOutlined,{}),"settings"===p?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:13,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:b})]})]})]})}],652272)},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),i=e.i(271645);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var r=e.i(9583),s=i.forwardRef(function(e,s){return i.createElement(r.default,(0,t.default)({},e,{ref:s,icon:a}))});e.s(["LinkOutlined",0,s],596239)},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),i=e.i(271645);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var r=e.i(9583),s=i.forwardRef(function(e,s){return i.createElement(r.default,(0,t.default)({},e,{ref:s,icon:a}))});e.s(["ArrowLeftOutlined",0,s],447566)},339019,865361,e=>{"use strict";var t,i,a=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edit",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t.REALTIME="realtime",t),r=((i={}).IMAGE="image",i.VIDEO="video",i.CHAT="chat",i.RESPONSES="responses",i.IMAGE_EDITS="image_edits",i.ANTHROPIC_MESSAGES="anthropic_messages",i.EMBEDDINGS="embeddings",i.SPEECH="speech",i.TRANSCRIPTION="transcription",i.A2A_AGENTS="a2a_agents",i.MCP="mcp",i.REALTIME="realtime",i.INTERACTIONS="interactions",i);let s={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edit:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings",realtime:"realtime"};e.s(["EndpointType",()=>r,"ModelMode",()=>a,"getEndpointType",0,e=>Object.values(a).includes(e)?s[e]:"chat"],865361),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:i,accessToken:a,apiKey:s,inputMessage:n,chatHistory:o,selectedTags:l,selectedVectorStores:d,selectedGuardrails:c,selectedPolicies:p,selectedVoice:m,endpointType:u,selectedModel:g,selectedSdk:h,proxySettings:f}=e,x="session"===i?a:s,b=window.location.origin,_=f?.LITELLM_UI_API_DOC_BASE_URL;_&&_.trim()?b=_:f?.PROXY_BASE_URL&&(b=f.PROXY_BASE_URL);let y=n||"Your prompt here",j=y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),w=o.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),v={};l.length>0&&(v.tags=l),d.length>0&&(v.vector_stores=d),c.length>0&&(v.guardrails=c),p.length>0&&(v.policies=p);let k=g||"your-model-name",N="azure"===h?`import openai | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,164668,e=>{"use strict";var t=e.i(717521);e.s(["LoaderCircle",()=>t.default])},62478,e=>{"use strict";var t=e.i(602869);let a=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,a])},592392,e=>{"use strict";var t=e.i(62478),a=e.i(266027);let i=(0,e.i(243652).createQueryKeys)("proxySettings"),r={PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null};e.s(["default",0,function(e){let{data:s}=(0,a.useQuery)({queryKey:[...i.all,e],queryFn:()=>(0,t.fetchProxySettings)(e),enabled:!!e});return s??r}])},283713,e=>{"use strict";var t=e.i(271645),a=e.i(602869),i=e.i(612256);let r="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,i.useUIConfig)(),s=e?.is_control_plane??!1,n=e?.workers??[],[o,l]=(0,t.useState)(()=>localStorage.getItem(r));(0,t.useEffect)(()=>{if(!o||0===n.length)return;let e=n.find(e=>e.worker_id===o);e&&(0,a.switchToWorkerUrl)(e.url)},[o,n]);let d=n.find(e=>e.worker_id===o)??null,c=(0,t.useCallback)(e=>{let t=n.find(t=>t.worker_id===e);t&&(l(e),localStorage.setItem(r,e),(0,a.switchToWorkerUrl)(t.url))},[n]);return{isControlPlane:s,workers:n,selectedWorkerId:o,selectedWorker:d,selectWorker:c,disconnectFromWorker:(0,t.useCallback)(()=>{l(null),localStorage.removeItem(r),(0,a.switchToWorkerUrl)(null)},[])}}])},251773,276701,771243,895335,e=>{"use strict";var t=e.i(843476),a=e.i(731565),i=e.i(602869),r=e.i(266027);async function s(){let e=(0,i.getProxyBaseUrl)(),t=await fetch(`${e}/public/litellm_blog_posts`);if(!t.ok)throw Error(`Failed to fetch blog posts: ${t.statusText}`);return t.json()}let n="inline-flex h-9 shrink-0 items-center justify-center gap-1 rounded-md px-2 text-sm font-medium leading-none text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-950";e.s(["NAV_PRODUCT_LINK_CLASS",0,n],276701);var o=e.i(519455),l=e.i(755146),d=e.i(664659),c=e.i(164668);e.s(["BlogDropdown",0,()=>{let e=(0,a.useDisableBlogPosts)(),{data:i,isLoading:p,isError:m,refetch:u}=(0,r.useQuery)({queryKey:["blogPosts"],queryFn:s,staleTime:36e5,retry:1,retryDelay:0});return e?null:(0,t.jsxs)(l.DropdownMenu,{modal:!1,children:[(0,t.jsxs)(l.DropdownMenuTrigger,{openOnHover:!0,closeDelay:100,render:(0,t.jsx)(o.Button,{variant:"ghost",className:`${n} border-0! bg-transparent!`}),children:["Blog",(0,t.jsx)(d.ChevronDown,{className:"size-2.5 text-gray-500","aria-hidden":!0})]}),(0,t.jsx)(l.DropdownMenuContent,{align:"end",side:"bottom",className:"w-auto",children:p?(0,t.jsx)("div",{className:"flex items-center px-2 py-1.5 text-sm",children:(0,t.jsx)(c.LoaderCircle,{role:"img","aria-label":"loading",className:"size-4 animate-spin"})}):m?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-sm",children:[(0,t.jsx)("span",{className:"text-destructive",children:"Failed to load posts"}),(0,t.jsx)(o.Button,{variant:"outline",size:"sm",onClick:()=>u(),children:"Retry"})]}):i&&0!==i.posts.length?(0,t.jsxs)(t.Fragment,{children:[i.posts.slice(0,5).map(e=>(0,t.jsx)(l.DropdownMenuItem,{children:(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",width:380},children:[(0,t.jsx)("h5",{className:"text-sm font-semibold",style:{marginBottom:2},children:e.title}),(0,t.jsx)("span",{className:"text-muted-foreground",style:{fontSize:11},children:new Date(e.date+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),(0,t.jsx)("p",{className:"line-clamp-2",children:e.description})]})},e.url)),(0,t.jsx)(l.DropdownMenuSeparator,{}),(0,t.jsx)(l.DropdownMenuItem,{children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/blog",target:"_blank",rel:"noopener noreferrer",children:"View all posts"})})]}):(0,t.jsx)("div",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No posts available"})})]})}],251773);var p=e.i(636772);e.i(176782),e.i(911825);var m=e.i(115504);e.i(772436);let u=(0,m.cva)({base:"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",variants:{orientation:{horizontal:"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",vertical:"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"}},defaultVariants:{orientation:"horizontal"}});function g({className:e,orientation:a,...i}){return(0,t.jsx)("div",{role:"group","data-slot":"button-group","data-orientation":a,className:(0,m.cn)(u({orientation:a}),e),...i})}var f=e.i(746798),h=e.i(475254);let x=(0,h.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),b=[{href:"https://www.litellm.ai/support",label:"Join Slack",tooltip:"LiteLLM Slack community",Icon:(0,h.default)("slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]])},{href:"https://github.com/BerriAI/litellm",label:"LiteLLM on GitHub",tooltip:"LiteLLM on GitHub",Icon:x}];e.s(["CommunityEngagementButtons",0,()=>(0,p.useDisableShowPrompts)()?null:(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsx)(g,{"aria-label":"Community links",children:b.map(({href:e,label:a,tooltip:i,Icon:r})=>(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{render:(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":a,className:(0,m.cn)((0,o.buttonVariants)({variant:"outline",size:"icon"}),"text-muted-foreground")}),children:(0,t.jsx)(r,{})}),(0,t.jsx)(f.TooltipContent,{children:i})]},e))})})],771243);var _=e.i(271645),y=e.i(115571);let j="litellmHideAutoRouterAnnouncement";function v(e){let t=t=>{t.key===j&&e()},a=t=>{let{key:a}=t.detail;a===j&&e()};return window.addEventListener("storage",t),window.addEventListener(y.LOCAL_STORAGE_EVENT,a),()=>{window.removeEventListener("storage",t),window.removeEventListener(y.LOCAL_STORAGE_EVENT,a)}}function w(){return"true"===(0,y.getLocalStorageItem)(j)}var k=e.i(487486),N=e.i(337822),S=e.i(245423);e.s(["NotificationsBell",0,()=>{let e=!(0,_.useSyncExternalStore)(v,w),[a,i]=(0,_.useState)(!1),r=(0,t.jsxs)("div",{className:"max-w-[280px]",children:[(0,t.jsx)(N.PopoverTitle,{className:"mt-0! mb-2!",children:"LiteLLM Auto Router"}),(0,t.jsx)(N.PopoverDescription,{className:"mb-3! text-sm leading-snug",children:"Route every request to the cheapest model that can handle it, no prompt changes needed."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("a",{className:(0,m.cn)((0,o.buttonVariants)({size:"sm"})),href:"https://docs.litellm.ai/docs/proxy/auto_routing",target:"_blank",rel:"noopener noreferrer",children:"Read the docs"}),e?(0,t.jsx)(o.Button,{variant:"link",size:"sm",className:"px-1!",onClick:()=>{(0,y.setLocalStorageItem)(j,"true"),(0,y.emitLocalStorageChange)(j),i(!1)},children:"Mark as read"}):null]})]});return(0,t.jsxs)(N.Popover,{open:a,onOpenChange:i,children:[(0,t.jsx)(N.PopoverTrigger,{className:"flex! h-9! w-9! items-center justify-center rounded-md! text-gray-600 transition-colors hover:bg-gray-100! hover:text-gray-900!","aria-label":"Notifications",children:(0,t.jsxs)("span",{className:"relative inline-flex",children:[(0,t.jsx)(S.Bell,{className:"size-4","aria-hidden":!0}),e?(0,t.jsx)(k.Badge,{className:"absolute -top-0.5 -right-1 size-1.5 p-0","aria-hidden":!0}):null]})}),(0,t.jsx)(N.PopoverContent,{align:"end",children:r})]})}],895335)},641141,e=>{"use strict";var t=e.i(843476),a=e.i(135214),i=e.i(731565),r=e.i(912089),s=e.i(636772),n=e.i(115571),o=e.i(222038),l=e.i(664659),d=e.i(344523),c=e.i(243553),p=e.i(292270),m=e.i(263488),u=e.i(581418),g=e.i(284614),f=e.i(799676),h=e.i(487486),x=e.i(337822),b=e.i(772436),_=e.i(699375),y=e.i(746798),j=e.i(922407),v=e.i(115504),w=e.i(271645);e.s(["default",0,({onLogout:e,variant:k="navbar",collapsed:N=!1})=>{let{userId:S,userEmail:C,userRoleLabel:I,premiumUser:z}=(0,a.default)(),L=(0,s.useDisableShowPrompts)(),A=(0,i.useDisableBlogPosts)(),$=(0,r.useDisableBouncingIcon)(),[D,E]=(0,w.useState)(!1);(0,w.useEffect)(()=>{E("true"===(0,n.getLocalStorageItem)("disableShowNewBadge"))},[]);let T=C||S||"user",P=function(e,t){let a=e?.split("@")[0]?.trim();if(a){let e=a.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);if(e.length>=2)return`${e[0].charAt(0)}${e[1].charAt(0)}`.toUpperCase();if(1===e.length){let t=e[0];return t.length>=2?t.slice(0,2).toUpperCase():`${t.charAt(0)}`.toUpperCase()}}return t&&t.length>=2?t.slice(0,2).toUpperCase():t&&1===t.length?`${t.toUpperCase()}•`:"?"}(C,S),M=function(e){let t=0;for(let a=0;a<e.length;a+=1)t=e.charCodeAt(a)+((t<<5)-t);return Math.abs(t)%360}(T),B=(0,o.navAccountDisplayName)(C,S);return(0,t.jsxs)(x.Popover,{children:["sidebar"===k?(0,t.jsxs)(x.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:(0,v.cn)("flex w-full items-center rounded-lg border border-transparent transition-colors hover:bg-sidebar-accent",N?"justify-center px-0 py-1":"gap-2.5 px-2 py-1.5 text-left"),"aria-label":`Account menu — ${I??"Unknown role"} — signed in as ${C||S||"unknown"}`,"aria-haspopup":"dialog",title:N?B:void 0}),children:[(0,t.jsx)(f.Avatar,{className:"size-[30px] shadow-inner ring-1 ring-black/5","aria-hidden":!0,children:(0,t.jsx)(f.AvatarFallback,{className:"font-semibold text-white",style:{backgroundColor:`hsl(${M} 46% 38%)`},children:P})}),!N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsx)("span",{className:"block truncate text-[13px] font-medium text-sidebar-foreground",children:B}),I&&(0,t.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:I})]}),(0,t.jsx)(d.ChevronsUpDown,{size:16,strokeWidth:1.75,className:"shrink-0 text-muted-foreground","aria-hidden":!0})]})]}):(0,t.jsxs)(x.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex! max-w-[min(200px,34vw)] items-center gap-2 rounded-md! py-0.5! pl-1! pr-2! transition-colors hover:bg-gray-100!","aria-label":`Account menu — ${I??"Unknown role"} — signed in as ${C||S||"unknown"}`,"aria-haspopup":"dialog"}),children:[(0,t.jsx)(f.Avatar,{className:"shadow-inner ring-1 ring-black/5","aria-hidden":!0,children:(0,t.jsx)(f.AvatarFallback,{className:"font-semibold text-white",style:{backgroundColor:`hsl(${M} 46% 38%)`},children:P})}),(0,t.jsx)("span",{className:"hidden min-w-0 truncate text-left text-sm font-medium leading-none text-gray-900 md:inline",children:B}),(0,t.jsx)(l.ChevronDown,{className:"hidden size-2.5 shrink-0 text-gray-400 md:inline","aria-hidden":!0})]}),(0,t.jsxs)(x.PopoverContent,{align:"sidebar"===k?"start":"end",side:"sidebar"===k?"top":"bottom",className:"w-auto gap-0 rounded-lg bg-white p-1 shadow-lg","data-testid":"user-dropdown-panel",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 p-3 text-sm",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.Mail,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:C||"-"})]}),z?(0,t.jsxs)(h.Badge,{children:[(0,t.jsx)(c.Crown,{className:"size-3"}),"Premium"]}):(0,t.jsx)(y.TooltipProvider,{children:(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsxs)(y.TooltipTrigger,{render:(0,t.jsx)(h.Badge,{variant:"outline"}),children:[(0,t.jsx)(c.Crown,{className:"size-3"}),"Standard"]}),(0,t.jsx)(y.TooltipContent,{side:"left",children:"Upgrade to Premium for advanced features"})]})})]}),(0,t.jsx)(b.Separator,{className:"my-2"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.User,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"User ID"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"max-w-[150px] truncate",title:S||"-",children:S||"-"}),(0,t.jsx)(j.default,{value:S,label:"Copy User ID"})]})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.ShieldCheck,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Role"})]}),(0,t.jsx)("span",{children:I})]}),(0,t.jsx)(b.Separator,{className:"my-2"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide New Feature Indicators"}),(0,t.jsx)(_.Switch,{size:"sm",checked:D,onCheckedChange:e=>{E(e),e?(0,n.setLocalStorageItem)("disableShowNewBadge","true"):(0,n.removeLocalStorageItem)("disableShowNewBadge"),(0,n.emitLocalStorageChange)("disableShowNewBadge")},"aria-label":"Toggle hide new feature indicators"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide All Prompts"}),(0,t.jsx)(_.Switch,{size:"sm",checked:L,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableShowPrompts","true"):(0,n.removeLocalStorageItem)("disableShowPrompts"),(0,n.emitLocalStorageChange)("disableShowPrompts")},"aria-label":"Toggle hide all prompts"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide Blog Posts"}),(0,t.jsx)(_.Switch,{size:"sm",checked:A,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableBlogPosts","true"):(0,n.removeLocalStorageItem)("disableBlogPosts"),(0,n.emitLocalStorageChange)("disableBlogPosts")},"aria-label":"Toggle hide blog posts"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide Bouncing Icon"}),(0,t.jsx)(_.Switch,{size:"sm",checked:$,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableBouncingIcon","true"):(0,n.removeLocalStorageItem)("disableBouncingIcon"),(0,n.emitLocalStorageChange)("disableBouncingIcon")},"aria-label":"Toggle hide bouncing icon"})]})]}),(0,t.jsx)(b.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:e,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",children:[(0,t.jsx)(p.LogOut,{className:"size-4"}),"Logout"]})]})]})}])},853295,658140,383862,e=>{"use strict";var t=e.i(843476),a=e.i(618566),i=e.i(755146),r=e.i(643531),s=e.i(344523),n=e.i(373264),o=e.i(271645),l=e.i(431703),d=e.i(602869);let c=(0,o.createContext)({mode:"ai-gateway",setMode:()=>{},plugins:[],activePlugin:null}),p="litellm_plugin_mode",m=(0,l.createApiClient)({getBaseUrl:()=>(0,d.getProxyBaseUrl)()??""});function u(){return localStorage.getItem(p)??"ai-gateway"}function g(){return(0,o.useContext)(c)}e.s(["PluginModeProvider",0,function({children:e,accessToken:a}){let[i,r]=(0,o.useState)(u),[s,n]=(0,o.useState)([]),[l,d]=(0,o.useState)(!1);(0,o.useEffect)(()=>{a&&m.get("/api/plugins",{accessToken:a}).then(e=>{n(Array.isArray(e)?e:[])}).catch(()=>{}).finally(()=>d(!0))},[a]);let g="ai-gateway"!==i&&l&&!s.some(e=>e.name===i)?"ai-gateway":i,f=s.find(e=>e.name===g)??null;return(0,t.jsx)(c.Provider,{value:{mode:g,setMode:e=>{r(e),localStorage.setItem(p,e)},plugins:s,activePlugin:f},children:e})},"usePluginMode",0,g],658140);var f=e.i(292639),h=e.i(571353);let x="chat";e.s(["default",0,function(){let{mode:e,setMode:o,plugins:l}=g(),{data:d}=(0,f.useUISettings)(),c=(0,a.usePathname)(),p=!!d?.values?.enable_chat_ui,m=(0,h.migratedHref)(x),u=(c??"").replace(/\/+$/,""),b=p&&(u===m||u.startsWith(`${m}/`)),_=b?"Chat":l.find(t=>t.name===e)?.display_name??"AI Gateway",y=[{key:"ai-gateway",label:"AI Gateway"},...l.map(e=>({key:e.name,label:e.display_name}))],j=p?{key:x,label:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-6 py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:"Chat"}),b&&(0,t.jsx)(r.Check,{className:"size-4 text-blue-600"})]}),onClick:()=>window.location.assign((0,h.migratedHref)(x))}:{key:x,disabled:!0,label:(0,t.jsxs)("div",{className:"flex max-w-[220px] flex-col py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:"Chat"}),(0,t.jsx)("span",{className:"whitespace-normal text-xs leading-snug text-muted-foreground",children:"Admins can enable in Settings"})]})},v=[...y.map(a=>({key:a.key,label:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-6 py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:a.label}),!b&&a.key===e&&(0,t.jsx)(r.Check,{className:"size-4 text-blue-600"})]}),onClick:()=>{o(a.key),b&&window.location.assign((0,h.migratedHref)(""))}})),j];return(0,t.jsxs)(i.DropdownMenu,{children:[(0,t.jsxs)(i.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex h-8 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background pl-1.5 pr-2 text-sm font-medium text-foreground transition-colors hover:bg-accent"}),children:[(0,t.jsx)("span",{className:"flex size-5 flex-none items-center justify-center rounded bg-muted text-muted-foreground",children:(0,t.jsx)(n.LayoutGrid,{className:"size-[13px]"})}),(0,t.jsx)("span",{className:"truncate",children:_}),(0,t.jsx)(s.ChevronsUpDown,{className:"size-3.5 flex-none text-muted-foreground"})]}),(0,t.jsx)(i.DropdownMenuContent,{className:"w-auto",children:v.map(e=>(0,t.jsx)(i.DropdownMenuItem,{disabled:e.disabled,onClick:e.onClick,children:e.label},e.key))})]})}],853295);var b=e.i(618393),_=e.i(131792),y=e.i(950594),j=e.i(283713);e.s(["default",0,({onWorkerSwitch:e})=>{let{isControlPlane:a,selectedWorker:i,workers:r}=(0,j.useWorker)();if(!a||!i)return null;let s=r.map(e=>({label:e.name,value:e.worker_id,disabled:e.worker_id===i.worker_id}));return(0,t.jsxs)(_.Combobox,{items:s,value:s.find(e=>e.value===i.worker_id)??null,itemToStringLabel:e=>e.label,onValueChange:t=>{t&&e(t.value)},children:[(0,t.jsx)(_.ComboboxInput,{className:"min-w-[180px]","aria-label":"Worker",children:(0,t.jsx)(y.InputGroupAddon,{align:"inline-start",children:(0,t.jsx)(b.Server,{className:"size-4"})})}),(0,t.jsxs)(_.ComboboxContent,{children:[(0,t.jsx)(_.ComboboxEmpty,{children:"No matching workers"}),(0,t.jsx)(_.ComboboxList,{children:e=>(0,t.jsx)(_.ComboboxItem,{value:e,disabled:e.disabled,children:e.label},e.value)})]})]})}],383862)},402874,e=>{"use strict";var t=e.i(843476),a=e.i(143488),i=e.i(912089),r=e.i(636772),s=e.i(283713),n=e.i(602869),o=e.i(571353),l=e.i(275144),d=e.i(268004),c=e.i(321836),p=e.i(592392),m=e.i(487486),u=e.i(664659),g=e.i(972518),f=e.i(799647),h=e.i(522016),x=e.i(251773),b=e.i(771243),_=e.i(276701),y=e.i(895335),j=e.i(641141),v=e.i(853295),w=e.i(383862);e.s(["default",0,({accessToken:e,isPublicPage:k=!1,sidebarCollapsed:N=!1,onToggleSidebar:S})=>{let C=(0,n.getProxyBaseUrl)(),I=(0,p.default)(e),{logoUrl:z}=(0,l.useTheme)(),{data:L}=(0,a.useHealthReadinessDetails)(e),A=L?.litellm_version,$=(0,i.useDisableBouncingIcon)(),D=(0,r.useDisableShowPrompts)(),{isControlPlane:E,selectedWorker:T}=(0,s.useWorker)(),P=E&&null!==T,M=z||`${C}/get_image`;return(0,t.jsx)("nav",{className:"sticky top-0 z-10 border-b border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"flex h-14 items-center px-4",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center",children:[S&&(0,t.jsx)("button",{onClick:S,className:"mr-2 flex h-9 w-9 items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900",title:N?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("span",{className:"text-lg",children:N?(0,t.jsx)(f.PanelLeftOpen,{className:"size-[18px]"}):(0,t.jsx)(g.PanelLeftClose,{className:"size-[18px]"})})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h.default,{href:(0,o.migratedHref)(""),className:"flex items-center",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"flex h-10 max-w-48 items-center justify-center overflow-hidden",children:(0,t.jsx)("img",{src:M,alt:"LiteLLM Brand",className:"h-auto max-h-full w-auto max-w-full object-contain"})})})}),A&&(0,t.jsxs)("div",{className:"relative",children:[!$&&(0,t.jsx)("span",{className:"absolute -left-2 -top-1 animate-bounce text-lg",style:{animationDuration:"2s"},title:"Thanks for using LiteLLM!",children:"🌑"}),(0,t.jsx)(m.Badge,{variant:"outline",className:"relative z-10 cursor-pointer text-xs font-medium",children:(0,t.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"shrink-0",children:["v",A]})})]})]})]}),!k&&(0,t.jsx)("div",{className:"ml-4 flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsx)(v.default,{})}),(0,t.jsxs)("div",{className:"ml-auto flex min-w-0 flex-1 items-center justify-end gap-4",children:[P&&(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(w.default,{onWorkerSwitch:e=>{(0,d.clearTokenCookies)(),(0,c.clearStoredReturnUrl)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=`${(0,c.getLoginUrl)()}?worker=${encodeURIComponent(e)}`}})}),(0,t.jsxs)("nav",{"aria-label":"Product documentation",className:`flex min-w-0 items-center gap-2 ${P?"border-l border-gray-200 pl-4":""}`,children:[(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:_.NAV_PRODUCT_LINK_CLASS,children:["Docs",(0,t.jsx)(u.ChevronDown,{className:"pointer-events-none size-2.5 opacity-0","aria-hidden":!0})]}),(0,t.jsx)(x.BlogDropdown,{})]}),!D&&(0,t.jsx)("div",{className:"flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsx)(b.CommunityEngagementButtons,{})}),!k&&(0,t.jsx)("div",{className:"flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-lg bg-gray-50 px-1 py-0 transition-colors hover:bg-gray-100",children:[(0,t.jsx)(y.NotificationsBell,{}),(0,t.jsx)("span",{className:"mx-0.5 h-6 w-px shrink-0 bg-gray-200","aria-hidden":!0}),(0,t.jsx)(j.default,{onLogout:()=>{(0,d.clearTokenCookies)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=I.PROXY_LOGOUT_URL||""}})]})})]})]})})})}])},879664,e=>{"use strict";let t=(0,e.i(475254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},952571,e=>{"use strict";var t=e.i(879664);e.s(["Info",()=>t.default])},233565,e=>{"use strict";var t=e.i(246349);e.s(["ChevronRightIcon",()=>t.default])},755146,e=>{"use strict";var t=e.i(843476),a=e.i(451512),i=e.i(115504);e.i(233565),e.i(678784),e.s(["DropdownMenu",0,function({...e}){return(0,t.jsx)(a.Menu.Root,{"data-slot":"dropdown-menu",...e})},"DropdownMenuContent",0,function({align:e="start",alignOffset:r=0,side:s="bottom",sideOffset:n=4,className:o,...l}){return(0,t.jsx)(a.Menu.Portal,{children:(0,t.jsx)(a.Menu.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:r,side:s,sideOffset:n,children:(0,t.jsx)(a.Menu.Popup,{"data-slot":"dropdown-menu-content",className:(0,i.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...l})})})},"DropdownMenuItem",0,function({className:e,inset:r,variant:s="default",...n}){return(0,t.jsx)(a.Menu.Item,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":s,className:(0,i.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...n})},"DropdownMenuSeparator",0,function({className:e,...r}){return(0,t.jsx)(a.Menu.Separator,{"data-slot":"dropdown-menu-separator",className:(0,i.cn)("-mx-1 my-1 h-px bg-border",e),...r})},"DropdownMenuTrigger",0,function({...e}){return(0,t.jsx)(a.Menu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}])},515288,e=>{"use strict";var t=e.i(843476),a=e.i(271645),i=e.i(115504);let r=a.forwardRef(({className:e,size:a="default",...r},s)=>(0,t.jsx)("div",{ref:s,"data-slot":"card","data-size":a,className:(0,i.cn)("group/card flex flex-col gap-(--card-spacing) rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r}));r.displayName="Card";let s=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-header",className:(0,i.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...a}));s.displayName="CardHeader";let n=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-title",className:(0,i.cn)("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",e),...a}));n.displayName="CardTitle";let o=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-description",className:(0,i.cn)("text-sm text-muted-foreground",e),...a}));o.displayName="CardDescription";let l=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-action",className:(0,i.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a}));l.displayName="CardAction";let d=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-content",className:(0,i.cn)("px-(--card-spacing)",e),...a}));d.displayName="CardContent";let c=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-footer",className:(0,i.cn)("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",e),...a}));c.displayName="CardFooter",e.s(["Card",0,r,"CardAction",0,l,"CardContent",0,d,"CardDescription",0,o,"CardFooter",0,c,"CardHeader",0,s,"CardTitle",0,n])},776639,e=>{"use strict";var t=e.i(843476),a=e.i(353753),i=e.i(115504),r=e.i(519455),s=e.i(995926);function n({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function o({className:e,...r}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"dialog-overlay",className:(0,i.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...r})}e.s(["Dialog",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"dialog",...e})},"DialogContent",0,function({className:e,children:l,showCloseButton:d=!0,...c}){return(0,t.jsxs)(n,{children:[(0,t.jsx)(o,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"dialog-content",className:(0,i.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...c,children:[l,d&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"dialog-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[(0,t.jsx)(s.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"dialog-description",className:(0,i.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...r})},"DialogFooter",0,function({className:e,showCloseButton:s=!1,children:n,...o}){return(0,t.jsxs)("div",{"data-slot":"dialog-footer",className:(0,i.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...o,children:[n,s&&(0,t.jsx)(a.Dialog.Close,{render:(0,t.jsx)(r.Button,{variant:"outline"}),children:"Close"})]})},"DialogHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2",e),...a})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"dialog-title",className:(0,i.cn)("leading-none font-medium",e),...r})}])},541071,373488,e=>{"use strict";let t=(0,e.i(475254).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["default",0,t],373488),e.s(["MoreHorizontal",0,t],541071)},434626,e=>{"use strict";var t=e.i(271645);let a=t.forwardRef(function(e,a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:a},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.s(["ExternalLinkIcon",0,a],434626)},339019,865361,e=>{"use strict";var t,a,i=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edit",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t.REALTIME="realtime",t),r=((a={}).IMAGE="image",a.VIDEO="video",a.CHAT="chat",a.RESPONSES="responses",a.IMAGE_EDITS="image_edits",a.ANTHROPIC_MESSAGES="anthropic_messages",a.EMBEDDINGS="embeddings",a.SPEECH="speech",a.TRANSCRIPTION="transcription",a.A2A_AGENTS="a2a_agents",a.MCP="mcp",a.REALTIME="realtime",a.INTERACTIONS="interactions",a);let s={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edit:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings",realtime:"realtime"};e.s(["EndpointType",()=>r,"ModelMode",()=>i,"getEndpointType",0,e=>Object.values(i).includes(e)?s[e]:"chat"],865361),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:a,accessToken:i,apiKey:s,inputMessage:n,chatHistory:o,selectedTags:l,selectedVectorStores:d,selectedGuardrails:c,selectedPolicies:p,selectedVoice:m,endpointType:u,selectedModel:g,selectedSdk:f,proxySettings:h}=e,x="session"===a?i:s,b=window.location.origin,_=h?.LITELLM_UI_API_DOC_BASE_URL;_&&_.trim()?b=_:h?.PROXY_BASE_URL&&(b=h.PROXY_BASE_URL);let y=n||"Your prompt here",j=y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),v=o.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),w={};l.length>0&&(w.tags=l),d.length>0&&(w.vector_stores=d),c.length>0&&(w.guardrails=c),p.length>0&&(w.policies=p);let k=g||"your-model-name",N="azure"===f?`import openai | |||
| @@ -0,0 +1,420 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,164668,e=>{"use strict";var t=e.i(717521);e.s(["LoaderCircle",()=>t.default])},62478,e=>{"use strict";var t=e.i(602869);let a=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,a])},592392,e=>{"use strict";var t=e.i(62478),a=e.i(266027);let i=(0,e.i(243652).createQueryKeys)("proxySettings"),r={PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null};e.s(["default",0,function(e){let{data:s}=(0,a.useQuery)({queryKey:[...i.all,e],queryFn:()=>(0,t.fetchProxySettings)(e),enabled:!!e});return s??r}])},283713,e=>{"use strict";var t=e.i(271645),a=e.i(602869),i=e.i(612256);let r="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,i.useUIConfig)(),s=e?.is_control_plane??!1,n=e?.workers??[],[o,l]=(0,t.useState)(()=>localStorage.getItem(r));(0,t.useEffect)(()=>{if(!o||0===n.length)return;let e=n.find(e=>e.worker_id===o);e&&(0,a.switchToWorkerUrl)(e.url)},[o,n]);let d=n.find(e=>e.worker_id===o)??null,c=(0,t.useCallback)(e=>{let t=n.find(t=>t.worker_id===e);t&&(l(e),localStorage.setItem(r,e),(0,a.switchToWorkerUrl)(t.url))},[n]);return{isControlPlane:s,workers:n,selectedWorkerId:o,selectedWorker:d,selectWorker:c,disconnectFromWorker:(0,t.useCallback)(()=>{l(null),localStorage.removeItem(r),(0,a.switchToWorkerUrl)(null)},[])}}])},251773,276701,771243,895335,e=>{"use strict";var t=e.i(843476),a=e.i(731565),i=e.i(602869),r=e.i(266027);async function s(){let e=(0,i.getProxyBaseUrl)(),t=await fetch(`${e}/public/litellm_blog_posts`);if(!t.ok)throw Error(`Failed to fetch blog posts: ${t.statusText}`);return t.json()}let n="inline-flex h-9 shrink-0 items-center justify-center gap-1 rounded-md px-2 text-sm font-medium leading-none text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-950";e.s(["NAV_PRODUCT_LINK_CLASS",0,n],276701);var o=e.i(519455),l=e.i(755146),d=e.i(664659),c=e.i(164668);e.s(["BlogDropdown",0,()=>{let e=(0,a.useDisableBlogPosts)(),{data:i,isLoading:p,isError:m,refetch:u}=(0,r.useQuery)({queryKey:["blogPosts"],queryFn:s,staleTime:36e5,retry:1,retryDelay:0});return e?null:(0,t.jsxs)(l.DropdownMenu,{modal:!1,children:[(0,t.jsxs)(l.DropdownMenuTrigger,{openOnHover:!0,closeDelay:100,render:(0,t.jsx)(o.Button,{variant:"ghost",className:`${n} border-0! bg-transparent!`}),children:["Blog",(0,t.jsx)(d.ChevronDown,{className:"size-2.5 text-gray-500","aria-hidden":!0})]}),(0,t.jsx)(l.DropdownMenuContent,{align:"end",side:"bottom",className:"w-auto",children:p?(0,t.jsx)("div",{className:"flex items-center px-2 py-1.5 text-sm",children:(0,t.jsx)(c.LoaderCircle,{role:"img","aria-label":"loading",className:"size-4 animate-spin"})}):m?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-sm",children:[(0,t.jsx)("span",{className:"text-destructive",children:"Failed to load posts"}),(0,t.jsx)(o.Button,{variant:"outline",size:"sm",onClick:()=>u(),children:"Retry"})]}):i&&0!==i.posts.length?(0,t.jsxs)(t.Fragment,{children:[i.posts.slice(0,5).map(e=>(0,t.jsx)(l.DropdownMenuItem,{children:(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",width:380},children:[(0,t.jsx)("h5",{className:"text-sm font-semibold",style:{marginBottom:2},children:e.title}),(0,t.jsx)("span",{className:"text-muted-foreground",style:{fontSize:11},children:new Date(e.date+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),(0,t.jsx)("p",{className:"line-clamp-2",children:e.description})]})},e.url)),(0,t.jsx)(l.DropdownMenuSeparator,{}),(0,t.jsx)(l.DropdownMenuItem,{children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/blog",target:"_blank",rel:"noopener noreferrer",children:"View all posts"})})]}):(0,t.jsx)("div",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No posts available"})})]})}],251773);var p=e.i(636772);e.i(176782),e.i(911825);var m=e.i(115504);e.i(772436);let u=(0,m.cva)({base:"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",variants:{orientation:{horizontal:"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",vertical:"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"}},defaultVariants:{orientation:"horizontal"}});function g({className:e,orientation:a,...i}){return(0,t.jsx)("div",{role:"group","data-slot":"button-group","data-orientation":a,className:(0,m.cn)(u({orientation:a}),e),...i})}var f=e.i(746798),h=e.i(475254);let x=(0,h.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),b=[{href:"https://www.litellm.ai/support",label:"Join Slack",tooltip:"LiteLLM Slack community",Icon:(0,h.default)("slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]])},{href:"https://github.com/BerriAI/litellm",label:"LiteLLM on GitHub",tooltip:"LiteLLM on GitHub",Icon:x}];e.s(["CommunityEngagementButtons",0,()=>(0,p.useDisableShowPrompts)()?null:(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsx)(g,{"aria-label":"Community links",children:b.map(({href:e,label:a,tooltip:i,Icon:r})=>(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{render:(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":a,className:(0,m.cn)((0,o.buttonVariants)({variant:"outline",size:"icon"}),"text-muted-foreground")}),children:(0,t.jsx)(r,{})}),(0,t.jsx)(f.TooltipContent,{children:i})]},e))})})],771243);var _=e.i(271645),y=e.i(115571);let j="litellmHideAutoRouterAnnouncement";function v(e){let t=t=>{t.key===j&&e()},a=t=>{let{key:a}=t.detail;a===j&&e()};return window.addEventListener("storage",t),window.addEventListener(y.LOCAL_STORAGE_EVENT,a),()=>{window.removeEventListener("storage",t),window.removeEventListener(y.LOCAL_STORAGE_EVENT,a)}}function w(){return"true"===(0,y.getLocalStorageItem)(j)}var k=e.i(487486),N=e.i(337822),S=e.i(245423);e.s(["NotificationsBell",0,()=>{let e=!(0,_.useSyncExternalStore)(v,w),[a,i]=(0,_.useState)(!1),r=(0,t.jsxs)("div",{className:"max-w-[280px]",children:[(0,t.jsx)(N.PopoverTitle,{className:"mt-0! mb-2!",children:"LiteLLM Auto Router"}),(0,t.jsx)(N.PopoverDescription,{className:"mb-3! text-sm leading-snug",children:"Route every request to the cheapest model that can handle it, no prompt changes needed."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("a",{className:(0,m.cn)((0,o.buttonVariants)({size:"sm"})),href:"https://docs.litellm.ai/docs/proxy/auto_routing",target:"_blank",rel:"noopener noreferrer",children:"Read the docs"}),e?(0,t.jsx)(o.Button,{variant:"link",size:"sm",className:"px-1!",onClick:()=>{(0,y.setLocalStorageItem)(j,"true"),(0,y.emitLocalStorageChange)(j),i(!1)},children:"Mark as read"}):null]})]});return(0,t.jsxs)(N.Popover,{open:a,onOpenChange:i,children:[(0,t.jsx)(N.PopoverTrigger,{className:"flex! h-9! w-9! items-center justify-center rounded-md! text-gray-600 transition-colors hover:bg-gray-100! hover:text-gray-900!","aria-label":"Notifications",children:(0,t.jsxs)("span",{className:"relative inline-flex",children:[(0,t.jsx)(S.Bell,{className:"size-4","aria-hidden":!0}),e?(0,t.jsx)(k.Badge,{className:"absolute -top-0.5 -right-1 size-1.5 p-0","aria-hidden":!0}):null]})}),(0,t.jsx)(N.PopoverContent,{align:"end",children:r})]})}],895335)},641141,e=>{"use strict";var t=e.i(843476),a=e.i(135214),i=e.i(731565),r=e.i(912089),s=e.i(636772),n=e.i(115571),o=e.i(222038),l=e.i(664659),d=e.i(344523),c=e.i(243553),p=e.i(292270),m=e.i(263488),u=e.i(581418),g=e.i(284614),f=e.i(799676),h=e.i(487486),x=e.i(337822),b=e.i(772436),_=e.i(699375),y=e.i(746798),j=e.i(922407),v=e.i(115504),w=e.i(271645);e.s(["default",0,({onLogout:e,variant:k="navbar",collapsed:N=!1})=>{let{userId:S,userEmail:C,userRoleLabel:I,premiumUser:z}=(0,a.default)(),L=(0,s.useDisableShowPrompts)(),A=(0,i.useDisableBlogPosts)(),$=(0,r.useDisableBouncingIcon)(),[D,E]=(0,w.useState)(!1);(0,w.useEffect)(()=>{E("true"===(0,n.getLocalStorageItem)("disableShowNewBadge"))},[]);let T=C||S||"user",P=function(e,t){let a=e?.split("@")[0]?.trim();if(a){let e=a.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);if(e.length>=2)return`${e[0].charAt(0)}${e[1].charAt(0)}`.toUpperCase();if(1===e.length){let t=e[0];return t.length>=2?t.slice(0,2).toUpperCase():`${t.charAt(0)}`.toUpperCase()}}return t&&t.length>=2?t.slice(0,2).toUpperCase():t&&1===t.length?`${t.toUpperCase()}•`:"?"}(C,S),M=function(e){let t=0;for(let a=0;a<e.length;a+=1)t=e.charCodeAt(a)+((t<<5)-t);return Math.abs(t)%360}(T),B=(0,o.navAccountDisplayName)(C,S);return(0,t.jsxs)(x.Popover,{children:["sidebar"===k?(0,t.jsxs)(x.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:(0,v.cn)("flex w-full items-center rounded-lg border border-transparent transition-colors hover:bg-sidebar-accent",N?"justify-center px-0 py-1":"gap-2.5 px-2 py-1.5 text-left"),"aria-label":`Account menu — ${I??"Unknown role"} — signed in as ${C||S||"unknown"}`,"aria-haspopup":"dialog",title:N?B:void 0}),children:[(0,t.jsx)(f.Avatar,{className:"size-[30px] shadow-inner ring-1 ring-black/5","aria-hidden":!0,children:(0,t.jsx)(f.AvatarFallback,{className:"font-semibold text-white",style:{backgroundColor:`hsl(${M} 46% 38%)`},children:P})}),!N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsx)("span",{className:"block truncate text-[13px] font-medium text-sidebar-foreground",children:B}),I&&(0,t.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:I})]}),(0,t.jsx)(d.ChevronsUpDown,{size:16,strokeWidth:1.75,className:"shrink-0 text-muted-foreground","aria-hidden":!0})]})]}):(0,t.jsxs)(x.PopoverTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex! max-w-[min(200px,34vw)] items-center gap-2 rounded-md! py-0.5! pl-1! pr-2! transition-colors hover:bg-gray-100!","aria-label":`Account menu — ${I??"Unknown role"} — signed in as ${C||S||"unknown"}`,"aria-haspopup":"dialog"}),children:[(0,t.jsx)(f.Avatar,{className:"shadow-inner ring-1 ring-black/5","aria-hidden":!0,children:(0,t.jsx)(f.AvatarFallback,{className:"font-semibold text-white",style:{backgroundColor:`hsl(${M} 46% 38%)`},children:P})}),(0,t.jsx)("span",{className:"hidden min-w-0 truncate text-left text-sm font-medium leading-none text-gray-900 md:inline",children:B}),(0,t.jsx)(l.ChevronDown,{className:"hidden size-2.5 shrink-0 text-gray-400 md:inline","aria-hidden":!0})]}),(0,t.jsxs)(x.PopoverContent,{align:"sidebar"===k?"start":"end",side:"sidebar"===k?"top":"bottom",className:"w-auto gap-0 rounded-lg bg-white p-1 shadow-lg","data-testid":"user-dropdown-panel",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 p-3 text-sm",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.Mail,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:C||"-"})]}),z?(0,t.jsxs)(h.Badge,{children:[(0,t.jsx)(c.Crown,{className:"size-3"}),"Premium"]}):(0,t.jsx)(y.TooltipProvider,{children:(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsxs)(y.TooltipTrigger,{render:(0,t.jsx)(h.Badge,{variant:"outline"}),children:[(0,t.jsx)(c.Crown,{className:"size-3"}),"Standard"]}),(0,t.jsx)(y.TooltipContent,{side:"left",children:"Upgrade to Premium for advanced features"})]})})]}),(0,t.jsx)(b.Separator,{className:"my-2"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.User,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"User ID"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"max-w-[150px] truncate",title:S||"-",children:S||"-"}),(0,t.jsx)(j.default,{value:S,label:"Copy User ID"})]})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.ShieldCheck,{className:"size-4"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Role"})]}),(0,t.jsx)("span",{children:I})]}),(0,t.jsx)(b.Separator,{className:"my-2"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide New Feature Indicators"}),(0,t.jsx)(_.Switch,{size:"sm",checked:D,onCheckedChange:e=>{E(e),e?(0,n.setLocalStorageItem)("disableShowNewBadge","true"):(0,n.removeLocalStorageItem)("disableShowNewBadge"),(0,n.emitLocalStorageChange)("disableShowNewBadge")},"aria-label":"Toggle hide new feature indicators"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide All Prompts"}),(0,t.jsx)(_.Switch,{size:"sm",checked:L,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableShowPrompts","true"):(0,n.removeLocalStorageItem)("disableShowPrompts"),(0,n.emitLocalStorageChange)("disableShowPrompts")},"aria-label":"Toggle hide all prompts"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide Blog Posts"}),(0,t.jsx)(_.Switch,{size:"sm",checked:A,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableBlogPosts","true"):(0,n.removeLocalStorageItem)("disableBlogPosts"),(0,n.emitLocalStorageChange)("disableBlogPosts")},"aria-label":"Toggle hide blog posts"})]}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Hide Bouncing Icon"}),(0,t.jsx)(_.Switch,{size:"sm",checked:$,onCheckedChange:e=>{e?(0,n.setLocalStorageItem)("disableBouncingIcon","true"):(0,n.removeLocalStorageItem)("disableBouncingIcon"),(0,n.emitLocalStorageChange)("disableBouncingIcon")},"aria-label":"Toggle hide bouncing icon"})]})]}),(0,t.jsx)(b.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:e,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",children:[(0,t.jsx)(p.LogOut,{className:"size-4"}),"Logout"]})]})]})}])},853295,658140,383862,e=>{"use strict";var t=e.i(843476),a=e.i(618566),i=e.i(755146),r=e.i(643531),s=e.i(344523),n=e.i(373264),o=e.i(271645),l=e.i(431703),d=e.i(602869);let c=(0,o.createContext)({mode:"ai-gateway",setMode:()=>{},plugins:[],activePlugin:null}),p="litellm_plugin_mode",m=(0,l.createApiClient)({getBaseUrl:()=>(0,d.getProxyBaseUrl)()??""});function u(){return localStorage.getItem(p)??"ai-gateway"}function g(){return(0,o.useContext)(c)}e.s(["PluginModeProvider",0,function({children:e,accessToken:a}){let[i,r]=(0,o.useState)(u),[s,n]=(0,o.useState)([]),[l,d]=(0,o.useState)(!1);(0,o.useEffect)(()=>{a&&m.get("/api/plugins",{accessToken:a}).then(e=>{n(Array.isArray(e)?e:[])}).catch(()=>{}).finally(()=>d(!0))},[a]);let g="ai-gateway"!==i&&l&&!s.some(e=>e.name===i)?"ai-gateway":i,f=s.find(e=>e.name===g)??null;return(0,t.jsx)(c.Provider,{value:{mode:g,setMode:e=>{r(e),localStorage.setItem(p,e)},plugins:s,activePlugin:f},children:e})},"usePluginMode",0,g],658140);var f=e.i(292639),h=e.i(571353);let x="chat";e.s(["default",0,function(){let{mode:e,setMode:o,plugins:l}=g(),{data:d}=(0,f.useUISettings)(),c=(0,a.usePathname)(),p=!!d?.values?.enable_chat_ui,m=(0,h.migratedHref)(x),u=(c??"").replace(/\/+$/,""),b=p&&(u===m||u.startsWith(`${m}/`)),_=b?"Chat":l.find(t=>t.name===e)?.display_name??"AI Gateway",y=[{key:"ai-gateway",label:"AI Gateway"},...l.map(e=>({key:e.name,label:e.display_name}))],j=p?{key:x,label:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-6 py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:"Chat"}),b&&(0,t.jsx)(r.Check,{className:"size-4 text-blue-600"})]}),onClick:()=>window.location.assign((0,h.migratedHref)(x))}:{key:x,disabled:!0,label:(0,t.jsxs)("div",{className:"flex max-w-[220px] flex-col py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:"Chat"}),(0,t.jsx)("span",{className:"whitespace-normal text-xs leading-snug text-muted-foreground",children:"Admins can enable in Settings"})]})},v=[...y.map(a=>({key:a.key,label:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-6 py-0.5",children:[(0,t.jsx)("span",{className:"font-medium",children:a.label}),!b&&a.key===e&&(0,t.jsx)(r.Check,{className:"size-4 text-blue-600"})]}),onClick:()=>{o(a.key),b&&window.location.assign((0,h.migratedHref)(""))}})),j];return(0,t.jsxs)(i.DropdownMenu,{children:[(0,t.jsxs)(i.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex h-8 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background pl-1.5 pr-2 text-sm font-medium text-foreground transition-colors hover:bg-accent"}),children:[(0,t.jsx)("span",{className:"flex size-5 flex-none items-center justify-center rounded bg-muted text-muted-foreground",children:(0,t.jsx)(n.LayoutGrid,{className:"size-[13px]"})}),(0,t.jsx)("span",{className:"truncate",children:_}),(0,t.jsx)(s.ChevronsUpDown,{className:"size-3.5 flex-none text-muted-foreground"})]}),(0,t.jsx)(i.DropdownMenuContent,{className:"w-auto",children:v.map(e=>(0,t.jsx)(i.DropdownMenuItem,{disabled:e.disabled,onClick:e.onClick,children:e.label},e.key))})]})}],853295);var b=e.i(618393),_=e.i(131792),y=e.i(950594),j=e.i(283713);e.s(["default",0,({onWorkerSwitch:e})=>{let{isControlPlane:a,selectedWorker:i,workers:r}=(0,j.useWorker)();if(!a||!i)return null;let s=r.map(e=>({label:e.name,value:e.worker_id,disabled:e.worker_id===i.worker_id}));return(0,t.jsxs)(_.Combobox,{items:s,value:s.find(e=>e.value===i.worker_id)??null,itemToStringLabel:e=>e.label,onValueChange:t=>{t&&e(t.value)},children:[(0,t.jsx)(_.ComboboxInput,{className:"min-w-[180px]","aria-label":"Worker",children:(0,t.jsx)(y.InputGroupAddon,{align:"inline-start",children:(0,t.jsx)(b.Server,{className:"size-4"})})}),(0,t.jsxs)(_.ComboboxContent,{children:[(0,t.jsx)(_.ComboboxEmpty,{children:"No matching workers"}),(0,t.jsx)(_.ComboboxList,{children:e=>(0,t.jsx)(_.ComboboxItem,{value:e,disabled:e.disabled,children:e.label},e.value)})]})]})}],383862)},402874,e=>{"use strict";var t=e.i(843476),a=e.i(143488),i=e.i(912089),r=e.i(636772),s=e.i(283713),n=e.i(602869),o=e.i(571353),l=e.i(275144),d=e.i(268004),c=e.i(321836),p=e.i(592392),m=e.i(487486),u=e.i(664659),g=e.i(972518),f=e.i(799647),h=e.i(522016),x=e.i(251773),b=e.i(771243),_=e.i(276701),y=e.i(895335),j=e.i(641141),v=e.i(853295),w=e.i(383862);e.s(["default",0,({accessToken:e,isPublicPage:k=!1,sidebarCollapsed:N=!1,onToggleSidebar:S})=>{let C=(0,n.getProxyBaseUrl)(),I=(0,p.default)(e),{logoUrl:z}=(0,l.useTheme)(),{data:L}=(0,a.useHealthReadinessDetails)(e),A=L?.litellm_version,$=(0,i.useDisableBouncingIcon)(),D=(0,r.useDisableShowPrompts)(),{isControlPlane:E,selectedWorker:T}=(0,s.useWorker)(),P=E&&null!==T,M=z||`${C}/get_image`;return(0,t.jsx)("nav",{className:"sticky top-0 z-10 border-b border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"flex h-14 items-center px-4",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center",children:[S&&(0,t.jsx)("button",{onClick:S,className:"mr-2 flex h-9 w-9 items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900",title:N?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("span",{className:"text-lg",children:N?(0,t.jsx)(f.PanelLeftOpen,{className:"size-[18px]"}):(0,t.jsx)(g.PanelLeftClose,{className:"size-[18px]"})})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h.default,{href:(0,o.migratedHref)(""),className:"flex items-center",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"flex h-10 max-w-48 items-center justify-center overflow-hidden",children:(0,t.jsx)("img",{src:M,alt:"LiteLLM Brand",className:"h-auto max-h-full w-auto max-w-full object-contain"})})})}),A&&(0,t.jsxs)("div",{className:"relative",children:[!$&&(0,t.jsx)("span",{className:"absolute -left-2 -top-1 animate-bounce text-lg",style:{animationDuration:"2s"},title:"Thanks for using LiteLLM!",children:"🌑"}),(0,t.jsx)(m.Badge,{variant:"outline",className:"relative z-10 cursor-pointer text-xs font-medium",children:(0,t.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"shrink-0",children:["v",A]})})]})]})]}),!k&&(0,t.jsx)("div",{className:"ml-4 flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsx)(v.default,{})}),(0,t.jsxs)("div",{className:"ml-auto flex min-w-0 flex-1 items-center justify-end gap-4",children:[P&&(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(w.default,{onWorkerSwitch:e=>{(0,d.clearTokenCookies)(),(0,c.clearStoredReturnUrl)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=`${(0,c.getLoginUrl)()}?worker=${encodeURIComponent(e)}`}})}),(0,t.jsxs)("nav",{"aria-label":"Product documentation",className:`flex min-w-0 items-center gap-2 ${P?"border-l border-gray-200 pl-4":""}`,children:[(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:_.NAV_PRODUCT_LINK_CLASS,children:["Docs",(0,t.jsx)(u.ChevronDown,{className:"pointer-events-none size-2.5 opacity-0","aria-hidden":!0})]}),(0,t.jsx)(x.BlogDropdown,{})]}),!D&&(0,t.jsx)("div",{className:"flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsx)(b.CommunityEngagementButtons,{})}),!k&&(0,t.jsx)("div",{className:"flex shrink-0 items-center border-l border-gray-200 pl-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-lg bg-gray-50 px-1 py-0 transition-colors hover:bg-gray-100",children:[(0,t.jsx)(y.NotificationsBell,{}),(0,t.jsx)("span",{className:"mx-0.5 h-6 w-px shrink-0 bg-gray-200","aria-hidden":!0}),(0,t.jsx)(j.default,{onLogout:()=>{(0,d.clearTokenCookies)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=I.PROXY_LOGOUT_URL||""}})]})})]})]})})})}])},879664,e=>{"use strict";let t=(0,e.i(475254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},952571,e=>{"use strict";var t=e.i(879664);e.s(["Info",()=>t.default])},233565,e=>{"use strict";var t=e.i(246349);e.s(["ChevronRightIcon",()=>t.default])},755146,e=>{"use strict";var t=e.i(843476),a=e.i(451512),i=e.i(115504);e.i(233565),e.i(678784),e.s(["DropdownMenu",0,function({...e}){return(0,t.jsx)(a.Menu.Root,{"data-slot":"dropdown-menu",...e})},"DropdownMenuContent",0,function({align:e="start",alignOffset:r=0,side:s="bottom",sideOffset:n=4,className:o,...l}){return(0,t.jsx)(a.Menu.Portal,{children:(0,t.jsx)(a.Menu.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:r,side:s,sideOffset:n,children:(0,t.jsx)(a.Menu.Popup,{"data-slot":"dropdown-menu-content",className:(0,i.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...l})})})},"DropdownMenuItem",0,function({className:e,inset:r,variant:s="default",...n}){return(0,t.jsx)(a.Menu.Item,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":s,className:(0,i.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...n})},"DropdownMenuSeparator",0,function({className:e,...r}){return(0,t.jsx)(a.Menu.Separator,{"data-slot":"dropdown-menu-separator",className:(0,i.cn)("-mx-1 my-1 h-px bg-border",e),...r})},"DropdownMenuTrigger",0,function({...e}){return(0,t.jsx)(a.Menu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}])},515288,e=>{"use strict";var t=e.i(843476),a=e.i(271645),i=e.i(115504);let r=a.forwardRef(({className:e,size:a="default",...r},s)=>(0,t.jsx)("div",{ref:s,"data-slot":"card","data-size":a,className:(0,i.cn)("group/card flex flex-col gap-(--card-spacing) rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r}));r.displayName="Card";let s=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-header",className:(0,i.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...a}));s.displayName="CardHeader";let n=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-title",className:(0,i.cn)("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",e),...a}));n.displayName="CardTitle";let o=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-description",className:(0,i.cn)("text-sm text-muted-foreground",e),...a}));o.displayName="CardDescription";let l=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-action",className:(0,i.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...a}));l.displayName="CardAction";let d=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-content",className:(0,i.cn)("px-(--card-spacing)",e),...a}));d.displayName="CardContent";let c=a.forwardRef(({className:e,...a},r)=>(0,t.jsx)("div",{ref:r,"data-slot":"card-footer",className:(0,i.cn)("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",e),...a}));c.displayName="CardFooter",e.s(["Card",0,r,"CardAction",0,l,"CardContent",0,d,"CardDescription",0,o,"CardFooter",0,c,"CardHeader",0,s,"CardTitle",0,n])},776639,e=>{"use strict";var t=e.i(843476),a=e.i(353753),i=e.i(115504),r=e.i(519455),s=e.i(995926);function n({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function o({className:e,...r}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"dialog-overlay",className:(0,i.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...r})}e.s(["Dialog",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"dialog",...e})},"DialogContent",0,function({className:e,children:l,showCloseButton:d=!0,...c}){return(0,t.jsxs)(n,{children:[(0,t.jsx)(o,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"dialog-content",className:(0,i.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...c,children:[l,d&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"dialog-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[(0,t.jsx)(s.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"DialogDescription",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"dialog-description",className:(0,i.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...r})},"DialogFooter",0,function({className:e,showCloseButton:s=!1,children:n,...o}){return(0,t.jsxs)("div",{"data-slot":"dialog-footer",className:(0,i.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...o,children:[n,s&&(0,t.jsx)(a.Dialog.Close,{render:(0,t.jsx)(r.Button,{variant:"outline"}),children:"Close"})]})},"DialogHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2",e),...a})},"DialogTitle",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"dialog-title",className:(0,i.cn)("leading-none font-medium",e),...r})}])},541071,373488,e=>{"use strict";let t=(0,e.i(475254).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["default",0,t],373488),e.s(["MoreHorizontal",0,t],541071)},434626,e=>{"use strict";var t=e.i(271645);let a=t.forwardRef(function(e,a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:a},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.s(["ExternalLinkIcon",0,a],434626)},339019,865361,e=>{"use strict";var t,a,i=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edit",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t.REALTIME="realtime",t),r=((a={}).IMAGE="image",a.VIDEO="video",a.CHAT="chat",a.RESPONSES="responses",a.IMAGE_EDITS="image_edits",a.ANTHROPIC_MESSAGES="anthropic_messages",a.EMBEDDINGS="embeddings",a.SPEECH="speech",a.TRANSCRIPTION="transcription",a.A2A_AGENTS="a2a_agents",a.MCP="mcp",a.REALTIME="realtime",a.INTERACTIONS="interactions",a);let s={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edit:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings",realtime:"realtime"};e.s(["EndpointType",()=>r,"ModelMode",()=>i,"getEndpointType",0,e=>Object.values(i).includes(e)?s[e]:"chat"],865361),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:a,accessToken:i,apiKey:s,inputMessage:n,chatHistory:o,selectedTags:l,selectedVectorStores:d,selectedGuardrails:c,selectedPolicies:p,selectedVoice:m,endpointType:u,selectedModel:g,selectedSdk:f,proxySettings:h}=e,x="session"===a?i:s,b=window.location.origin,_=h?.LITELLM_UI_API_DOC_BASE_URL;_&&_.trim()?b=_:h?.PROXY_BASE_URL&&(b=h.PROXY_BASE_URL);let y=n||"Your prompt here",j=y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),v=o.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),w={};l.length>0&&(w.tags=l),d.length>0&&(w.vector_stores=d),c.length>0&&(w.guardrails=c),p.length>0&&(w.policies=p);let k=g||"your-model-name",N="azure"===f?`import openai | |||
| @@ -0,0 +1,35 @@ | |||
| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,515288,e=>{"use strict";var r=e.i(843476),t=e.i(271645),a=e.i(115504);let s=t.forwardRef(({className:e,size:t="default",...s},d)=>(0,r.jsx)("div",{ref:d,"data-slot":"card","data-size":t,className:(0,a.cn)("group/card flex flex-col gap-(--card-spacing) rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s}));s.displayName="Card";let d=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,"data-slot":"card-header",className:(0,a.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t}));d.displayName="CardHeader";let i=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,"data-slot":"card-title",className:(0,a.cn)("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",e),...t}));i.displayName="CardTitle";let o=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,"data-slot":"card-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...t}));o.displayName="CardDescription";let n=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,"data-slot":"card-action",className:(0,a.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t}));n.displayName="CardAction";let l=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,"data-slot":"card-content",className:(0,a.cn)("px-(--card-spacing)",e),...t}));l.displayName="CardContent";let c=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,"data-slot":"card-footer",className:(0,a.cn)("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",e),...t}));c.displayName="CardFooter",e.s(["Card",0,s,"CardAction",0,n,"CardContent",0,l,"CardDescription",0,o,"CardFooter",0,c,"CardHeader",0,d,"CardTitle",0,i])},972520,e=>{"use strict";let r=(0,e.i(475254).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",0,r],972520)},411929,e=>{"use strict";var r=e.i(843476),t=e.i(271645),a=e.i(972520),s=e.i(174886),d=e.i(519455),i=e.i(515288),o=e.i(624687),n=e.i(571303),l=e.i(602869),c=e.i(727749);let u=({accessToken:e})=>{let[u,m]=(0,t.useState)(`{ | |||
The log details drawer moved off Ant Design in 03d2b16, so its section header renders lucide ChevronUp/ChevronDown rather than antd's UpOutlined and DownOutlined. The collapse test still waited on .anticon-up and .anticon-down, which no longer exist anywhere under view_logs, so it failed on every run and burned all three attempts identically. Point the three assertions at .lucide-chevron-up and .lucide-chevron-down, matching how the dashboard's other suites address lucide icons.
test(e2e/ui): assert the log drawer chevrons by their lucide classes
TLDR
Problem this solves:
How it solves it:
User Flow
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Caveats (if any)
QA runbook
Final Attestation