The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
refactor(make): stop queueing bootstrap for a machine-wide gate slot
mateoc9697cbce56b
diff --git a/CLAUDE.md b/CLAUDE.mdindex e6eea912cd5..fb616115941 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -53,7 +53,7 @@ When you fix violations gated by `ruff-strict-budget.json`, `type-discipline-bud`make check` (f.k.a. `make pre-commit`, which still works identically as an alias) saves its complete output to a log file in .git (overwriting previous logs) and prints that path as its first and last output lines. To inspect a run, read or grep that log instead of re-running the multi-minute checks just to see a different slice-`make check`, `make lint`, `make bootstrap`, `scripts/pre_commit_lint.sh`, and the standalone budget gates (`scripts/ruff_strict_gate.py`, `scripts/type_discipline_gate.py`, `scripts/type_check_gate.py`) each hold one of `LITELLM_GATE_SLOTS` machine-wide slots (default 2, see `scripts/gate_slot_lock.py`), so when other sessions or worktrees on the same box are already running heavy work, yours prints "all N machine-wide slots are busy; queueing" and then stays quiet until a slot frees. Queueing is expected, so give the command a long timeout and let it wait rather than killing it, retrying it, or assuming it hung. Don't defeat the queue by setting `LITELLM_GATE_SLOTS=0` or raising the slot count, and don't fan heavy targets out into parallel shells, since they'd only queue behind each other anyway. Prefer top-level `make check` / `make lint` over `check-inner` / `lint-inner`: the inner targets are still slot-aware, but they take a slot per nested gate over the run instead of one slot for the whole thing+`make check`, `make lint`, `scripts/pre_commit_lint.sh`, and the standalone budget gates (`scripts/ruff_strict_gate.py`, `scripts/type_discipline_gate.py`, `scripts/type_check_gate.py`) each hold one of `LITELLM_GATE_SLOTS` machine-wide slots (default 2, see `scripts/gate_slot_lock.py`), so when other sessions or worktrees on the same box are already running heavy work, yours prints "all N machine-wide slots are busy; queueing" and then stays quiet until a slot frees. Queueing is expected, so give the command a long timeout and let it wait rather than killing it, retrying it, or assuming it hung. Don't defeat the queue by setting `LITELLM_GATE_SLOTS=0` or raising the slot count, and don't fan heavy targets out into parallel shells, since they'd only queue behind each other anyway. Prefer top-level `make check` / `make lint` over `check-inner` / `lint-inner`: the inner targets are still slot-aware, but they take a slot per nested gate over the run instead of one slot for the whole thingIf you're trying to create a new function that relies on untyped stuff, instead of adding more Any's and pushing `reportAny` / `reportExplicitAny` closer to their basedpyright ceilings, just validate it in the caller with Pydantic (a model or `TypeAdapter` that returns the typed thing or raises will do) and then pass the now typed variable indiff --git a/Makefile b/Makefileindex bdb643e3ec9..5e5f7c80027 100644--- a/Makefile+++ b/Makefile@@ -9,7 +9,7 @@lint-ruff-budget lint-ruff-budget-update lint-budget-update lint-gate \install-dev install-proxy-dev install-test-deps install-hooks \install-helm-unittest check-circular-imports check-import-safety check check-inner pre-commit \- lint-install lint-fetch-base bootstrap bootstrap-inner+ lint-install lint-fetch-base bootstrap# Default targethelp:@@ -53,7 +53,7 @@ help:@echo " make test-integration - Run integration tests"@echo " make test-unit-helm - Run helm unit tests"@echo ""- @echo "Heavy targets (check, bootstrap, lint) queue for LITELLM_GATE_SLOTS machine-wide"+ @echo "Heavy targets (check, lint) queue for LITELLM_GATE_SLOTS machine-wide"@echo "slots (default 2; 0 disables) so parallel sessions don't thrash one machine."UV := uv@@ -80,10 +80,9 @@ info:install-dev:$(UV) sync --inexact --frozen+# Deliberately unqueued: provisioning is I/O bound, so it doesn't need one of the+# machine-wide slots the CPU-bound gates below share.bootstrap:- @$(GATE_SLOT_LOCK) $(MAKE) bootstrap-inner--bootstrap-inner:$(UV) sync --inexact --frozen --extra proxy --group proxy-dev --group e2e-dev$(UV_RUN) python scripts/prisma_generate_if_needed.pycd ui/litellm-dashboard && ../../scripts/with_dashboard_node.sh npm install --no-audit --no-funddiff --git a/scripts/gate_slot_lock.py b/scripts/gate_slot_lock.pyindex e7bd945ad65..999b28ced1c 100644--- a/scripts/gate_slot_lock.py+++ b/scripts/gate_slot_lock.py@@ -1,7 +1,7 @@#!/usr/bin/env python3"""Machine-wide slot lock for this repo's heavy entrypoints.-`make check`, `make bootstrap`, `make lint`, and the standalone budget gates+`make check`, `make lint`, and the standalone budget gates(scripts/ruff_strict_gate.py, scripts/type_discipline_gate.py,scripts/type_check_gate.py) each hold one of N machine-wide slots while theyrun, so however many sessions and worktrees share one machine, at most N of