@@ -484,4 +484,96 @@ comments.
484484
485485Use hyphens instead of underscores in flag names (e.g. `my-flag` instead of
486486`my_flag`).
487- --- End of Context from: GEMINI.md ---
487+ --- End of Context from: GEMINI.md ---
488+
489+ --- Context from: litellm/GEMINI.md ---
490+ # GEMINI.md
491+
492+ This file provides guidance to Gemini when working with code in this repository.
493+
494+ ## Development Commands
495+
496+ ### Installation
497+ - `make install-dev` - Install core development dependencies
498+ - `make install-proxy-dev` - Install proxy development dependencies with full feature set
499+ - `make install-test-deps` - Install all test dependencies
500+
501+ ### Testing
502+ - `make test` - Run all tests
503+ - `make test-unit` - Run unit tests (tests/test_litellm) with 4 parallel workers
504+ - `make test-integration` - Run integration tests (excludes unit tests)
505+ - `pytest tests/` - Direct pytest execution
506+
507+ ### Code Quality
508+ - `make lint` - Run all linting (Ruff, MyPy, Black, circular imports, import safety)
509+ - `make format` - Apply Black code formatting
510+ - `make lint-ruff` - Run Ruff linting only
511+ - `make lint-mypy` - Run MyPy type checking only
512+
513+ ### Single Test Files
514+ - `poetry run pytest tests/path/to/test_file.py -v` - Run specific test file
515+ - `poetry run pytest tests/path/to/test_file.py::test_function -v` - Run specific test
516+
517+ ## Architecture Overview
518+
519+ LiteLLM is a unified interface for 100+ LLM providers with two main components:
520+
521+ ### Core Library (`litellm/`)
522+ - **Main entry point**: `litellm/main.py` - Contains core completion() function
523+ - **Provider implementations**: `litellm/llms/` - Each provider has its own subdirectory
524+ - **Router system**: `litellm/router.py` + `litellm/router_utils/` - Load balancing and fallback logic
525+ - **Type definitions**: `litellm/types/` - Pydantic models and type hints
526+ - **Integrations**: `litellm/integrations/` - Third-party observability, caching, logging
527+ - **Caching**: `litellm/caching/` - Multiple cache backends (Redis, in-memory, S3, etc.)
528+
529+ ### Proxy Server (`litellm/proxy/`)
530+ - **Main server**: `proxy_server.py` - FastAPI application
531+ - **Authentication**: `auth/` - API key management, JWT, OAuth2
532+ - **Database**: `db/` - Prisma ORM with PostgreSQL/SQLite support
533+ - **Management endpoints**: `management_endpoints/` - Admin APIs for keys, teams, models
534+ - **Pass-through endpoints**: `pass_through_endpoints/` - Provider-specific API forwarding
535+ - **Guardrails**: `guardrails/` - Safety and content filtering hooks
536+ - **UI Dashboard**: Served from `_experimental/out/` (Next.js build)
537+
538+ ## Key Patterns
539+
540+ ### Provider Implementation
541+ - Providers inherit from base classes in `litellm/llms/base.py`
542+ - Each provider has transformation functions for input/output formatting
543+ - Support both sync and async operations
544+ - Handle streaming responses and function calling
545+
546+ ### Error Handling
547+ - Provider-specific exceptions mapped to OpenAI-compatible errors
548+ - Fallback logic handled by Router system
549+ - Comprehensive logging through `litellm/_logging.py`
550+
551+ ### Configuration
552+ - YAML config files for proxy server (see `proxy/example_config_yaml/`)
553+ - Environment variables for API keys and settings
554+ - Database schema managed via Prisma (`proxy/schema.prisma`)
555+
556+ ## Development Notes
557+
558+ ### Code Style
559+ - Uses Black formatter, Ruff linter, MyPy type checker
560+ - Pydantic v2 for data validation
561+ - Async/await patterns throughout
562+ - Type hints required for all public APIs
563+
564+ ### Testing Strategy
565+ - Unit tests in `tests/test_litellm/`
566+ - Integration tests for each provider in `tests/llm_translation/`
567+ - Proxy tests in `tests/proxy_unit_tests/`
568+ - Load tests in `tests/load_tests/`
569+
570+ ### Database Migrations
571+ - Prisma handles schema migrations
572+ - Migration files auto-generated with `prisma migrate dev`
573+ - Always test migrations against both PostgreSQL and SQLite
574+
575+ ### Enterprise Features
576+ - Enterprise-specific code in `enterprise/` directory
577+ - Optional features enabled via environment variables
578+ - Separate licensing and authentication for enterprise features
579+ --- End of Context from: litellm/GEMINI.md ---
0 commit comments