Update DEPLOYMENT.md with critical .env format requirements

- Emphasize that inline comments cause service startup failures
- Show correct .env format without inline comments
- Add example error message when inline comments are present
- Include sed command to fix existing .env files with inline comments
- Add model mapping examples in correct format
This commit is contained in:
2026-02-23 12:20:16 -05:00
parent d924b7c45f
commit 0ed0ae9ce8

View File

@@ -56,9 +56,9 @@ Create `.env` file (copy from `.env.example`):
cp .env.example .env
```
**IMPORTANT**: Remove all inline comments from `.env` file. Pydantic cannot parse values with inline comments.
**CRITICAL**: The `.env` file must NOT contain inline comments. Pydantic cannot parse environment variables with inline comments and will cause the service to fail with validation errors.
**Correct format:**
**Correct format (no inline comments):**
```bash
IBM_CLOUD_API_KEY=your_api_key_here
WATSONX_PROJECT_ID=your_project_id_here
@@ -67,14 +67,35 @@ HOST=0.0.0.0
PORT=8000
LOG_LEVEL=info
TOKEN_REFRESH_INTERVAL=3000
# Model mappings (optional)
MODEL_MAP_GPT4=openai/gpt-oss-120b
MODEL_MAP_GPT4_TURBO=meta-llama/llama-3-3-70b-instruct
MODEL_MAP_GPT4_TURBO_PREVIEW=mistral-large-2512
```
**Incorrect format (will cause errors):**
**Incorrect format (will cause service startup failure):**
```bash
# ❌ DO NOT USE INLINE COMMENTS - Service will fail to start
LOG_LEVEL=info # Options: debug, info, warning, error
TOKEN_REFRESH_INTERVAL=3000 # Refresh token every N seconds
```
**Error you'll see if inline comments are present:**
```
pydantic_core._pydantic_core.ValidationError: 1 validation error for Settings
token_refresh_interval
Input should be a valid integer, unable to parse string as an integer
```
**To fix existing .env files with inline comments:**
```bash
# Remove all inline comments
sed -i 's/\s*#.*$//' /home/app/watsonx-openai-proxy/.env
# Or manually edit and remove everything after the value on each line
```
## Systemd Service Setup
### 1. Create Service Unit