Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
db7075b
feat(setup): add interactive setup wizard + install.sh
ishaan-jaff Mar 14, 2026
f765541
fix(install.sh): remove orange color, add LITELLM_BRANCH env var for …
ishaan-jaff Mar 14, 2026
3998b47
fix(install.sh): install from git branch so --setup is available for QA
ishaan-jaff Mar 14, 2026
027174d
fix(install.sh): remove stale LITELLM_BRANCH reference that caused un…
ishaan-jaff Mar 14, 2026
c0d1ac9
fix(install.sh): force-reinstall from git to bypass cached PyPI version
ishaan-jaff Mar 14, 2026
6871959
fix(install.sh): show pip progress bar during install
ishaan-jaff Mar 14, 2026
f99be57
fix(install.sh): always launch wizard via $PYTHON_BIN -m litellm, not…
ishaan-jaff Mar 14, 2026
5c757ba
fix(install.sh): use litellm.proxy.proxy_cli module (no __main__.py e…
ishaan-jaff Mar 14, 2026
86162d7
fix(install.sh): suppress RuntimeWarning from module invocation
ishaan-jaff Mar 14, 2026
2b3d8a1
fix(install.sh): use Python bin-dir litellm binary to avoid CWD sys.p…
ishaan-jaff Mar 14, 2026
29fa7c0
fix(install.sh): use sysconfig.get_path('scripts') to find pip-instal…
ishaan-jaff Mar 14, 2026
fa1c412
fix(install.sh): redirect stdin from /dev/tty on exec so wizard gets …
ishaan-jaff Mar 14, 2026
cf1b12b
fix(install.sh): warn about git clone duration, drop --no-cache-dir s…
ishaan-jaff Mar 14, 2026
8413fbc
feat(setup_wizard): arrow-key selector, updated model names
ishaan-jaff Mar 14, 2026
967fd46
fix(setup_wizard): use sysconfig binary to start proxy, not python -m…
ishaan-jaff Mar 14, 2026
bab4f16
feat(setup_wizard): credential validation after key entry + clear nex…
ishaan-jaff Mar 14, 2026
d5b7b51
style(install.sh): show git clone warning in blue
ishaan-jaff Mar 14, 2026
cd85a3b
refactor(setup_wizard): class with static methods, use check_valid_ke…
ishaan-jaff Mar 14, 2026
7ab9d06
address greptile review: fix yaml escaping, port validation, display …
ishaan-jaff Mar 14, 2026
6d95dde
style: black format setup_wizard.py
ishaan-jaff Mar 14, 2026
1fbf098
fix: address remaining greptile issues - Windows compat, YAML quoting…
ishaan-jaff Mar 14, 2026
d1aa702
fix: add --port to suggested command, guard /dev/tty exec in install.sh
ishaan-jaff Mar 14, 2026
78f513f
fix: quote api_base in YAML, skip azure if no deployment, only redraw…
ishaan-jaff Mar 14, 2026
0e77077
fix: address greptile review comments
ishaan-jaff Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ LiteLLM is a unified interface for 100+ LLM providers with two main components:
- **Check index coverage.** For new or modified queries, check `schema.prisma` for a supporting index. Prefer extending an existing index (e.g. `@@index([a])` → `@@index([a, b])`) over adding a new one, unless it's a `@@unique`. Only add indexes for large/frequent queries.
- **Keep schema files in sync.** Apply schema changes to all `schema.prisma` copies (`schema.prisma`, `litellm/proxy/`, `litellm-proxy-extras/`, `litellm-js/spend-logs/` for SpendLogs) with a migration under `litellm-proxy-extras/litellm_proxy_extras/migrations/`.

### Setup Wizard (`litellm/setup_wizard.py`)
- The wizard is implemented as a single `SetupWizard` class with `@staticmethod` methods — keep it that way. No module-level functions except `run_setup_wizard()` (the public entrypoint) and pure helpers (color, ANSI).
- Use `litellm.utils.check_valid_key(model, api_key)` for credential validation — never roll a custom completion call.
- Do not hardcode provider env-key names or model lists that already exist in the codebase. Add a `test_model` field to each provider entry to drive `check_valid_key`; set it to `None` for providers that can't be validated with a single API key (Azure, Bedrock, Ollama).

### Enterprise Features
- Enterprise-specific code in `enterprise/` directory
- Optional features enabled via environment variables
Expand Down
15 changes: 14 additions & 1 deletion litellm/proxy/proxy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ def _maybe_setup_prometheus_multiproc_dir(
type=str,
help="Path to the logging configuration file",
)
@click.option(
"--setup",
is_flag=True,
default=False,
help="Run the interactive setup wizard to configure providers and generate a config file",
)
@click.option(
"--version",
"-v",
Expand Down Expand Up @@ -598,6 +604,7 @@ def run_server( # noqa: PLR0915
num_requests,
use_queue,
health,
setup,
version,
run_gunicorn,
run_hypercorn,
Expand All @@ -611,6 +618,12 @@ def run_server( # noqa: PLR0915
max_requests_before_restart,
enforce_prisma_migration_check: bool,
):
if setup:
from litellm.setup_wizard import run_setup_wizard

run_setup_wizard()
return

args = locals()
if local:
from proxy_server import (
Expand Down Expand Up @@ -904,7 +917,7 @@ def run_server( # noqa: PLR0915
# Auto-create PROMETHEUS_MULTIPROC_DIR for multi-worker setups
ProxyInitializationHelpers._maybe_setup_prometheus_multiproc_dir(
num_workers=num_workers,
litellm_settings=litellm_settings if config else None,
litellm_settings=litellm_settings if config else None, # type: ignore[possibly-unbound]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: ignore[possibly-unbound] masks a real NameError risk

The # type: ignore[possibly-unbound] comment suppresses Pyright's warning that litellm_settings may not be assigned before this call. This variable is conditionally populated by the config-loading branch earlier in run_server; if config is falsy the conditional litellm_settings if config else None guards against using an unbound name at runtime, but only in this one specific call site.

If the code path is ever refactored and this guard is removed (or a second call site is introduced without it), a real NameError could reach production. The safer fix is to ensure litellm_settings has a well-typed default at the point of assignment, which would remove the need for the suppression comment entirely:

litellm_settings: Optional[dict] = None
# ... (existing config-loading block conditionally assigns litellm_settings)

ProxyInitializationHelpers._maybe_setup_prometheus_multiproc_dir(
    num_workers=num_workers,
    litellm_settings=litellm_settings,  # no type: ignore needed
)

)

# --- SEPARATE HEALTH APP LOGIC ---
Expand Down
Loading
Loading