-
Created .env.template file - Added a template file for environment variables with the following variables:
- LITELLM_API_KEY
- LITELLM_API_URL
- LITELLM_API_BASE
- AICHAT_CONFIG_PATH
- AZURE_SUBSCRIPTION_ID
-
Updated aichat_config_setup.py:
- Added python-dotenv import and load_dotenv() call
- Replaced hardcoded API key with os.getenv("LITELLM_API_KEY")
- Replaced hardcoded API URL with os.getenv("LITELLM_API_URL", "http://localhost:4141/v1/model/info")
- Replaced hardcoded API base with os.getenv("LITELLM_API_BASE", "http://localhost:4141")
- Replaced hardcoded file path with os.getenv("AICHAT_CONFIG_PATH", "./config.yaml")
-
Updated check_auzre_llm_in_litellm.py:
- Added python-dotenv import and load_dotenv() call
- Replaced hardcoded API key with os.getenv("LITELLM_API_KEY")
- Replaced hardcoded API URL with os.getenv("LITELLM_API_URL", "http://localhost:4141/v1/model/info")
-
Updated README.md:
- Added setup instructions for creating and configuring the .env file
- Added instructions for installing required packages
- Added instructions for running the scripts
-
Created requirements.txt:
- Added python-dotenv, requests, azure-identity, and azure-mgmt-cognitiveservices packages
-
Created test_env_vars.py:
- Added a test script to verify that environment variables are loaded correctly
- LITELLM_API_KEY: The API key for LiteLLM
- LITELLM_API_URL: The URL for the LiteLLM model info endpoint
- LITELLM_API_BASE: The base URL for LiteLLM API
- AICHAT_CONFIG_PATH: The path to the aichat config file
- AZURE_SUBSCRIPTION_ID: The Azure subscription ID for Azure AI services
- Security: No more hardcoded secrets in the source code
- Flexibility: Easy to configure for different environments
- Portability: Works across different systems without code changes
- Maintainability: Centralized configuration in .env file