Configure OpenAI provider and GPT-5 models - #174
Conversation
WalkthroughThis change introduces support for OpenAI models in the LiteLLM configuration. It adds new environment variables for the OpenAI API key in both the example Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Docker Compose
participant LiteLLM Service
participant OpenAI API
User->>Docker Compose: Sets OPENAI_API_KEY in .env
Docker Compose->>LiteLLM Service: Passes OPENAI_API_KEY as env var
LiteLLM Service->>OpenAI API: Uses OPENAI_API_KEY for gpt-5/gpt-5-mini requests
OpenAI API-->>LiteLLM Service: Returns model response
LiteLLM Service-->>User: Delivers response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
config-example/docker/myhost/.env (1)
101-102: dotenv-linter quote warnings — pick a consistent policy.Static analysis flags quotes around values. The rest of this file uses quotes, so you can either:
- keep quotes and configure dotenv-linter to allow them for example files, or
- remove quotes across the file (not just these lines) to satisfy the linter.
Your call; just keep it consistent.
Also applies to: 107-108
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
config-example/docker/myhost/.env(1 hunks)docker/ai/litellm.yaml(1 hunks)docker/ai/litellm/config.yaml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{sh,Dockerfile,yml,yaml,tf}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Follow the pre-commit rules defined in .pre-commit-config.yaml, which includes linting for shell scripts, Dockerfiles, YAML files, Ansible playbooks, and Terraform configurations.
Files:
docker/ai/litellm/config.yamldocker/ai/litellm.yaml
docker/**/*.{yml,yaml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Docker Compose files for services should be placed under the docker/ directory, organized by service type (e.g., security, media, storage, monitoring).
Files:
docker/ai/litellm/config.yamldocker/ai/litellm.yaml
🪛 dotenv-linter (3.3.0)
config-example/docker/myhost/.env
[warning] 102-102: [QuoteCharacter] The value has quote characters (', ")
[warning] 105-105: [QuoteCharacter] The value has quote characters (', ")
[warning] 108-108: [QuoteCharacter] The value has quote characters (', ")
🔇 Additional comments (4)
config-example/docker/myhost/.env (2)
101-102: OPENAI_API_KEY placeholder addition aligns with service/config usage.Matches docker/ai/litellm.yaml and docker/ai/litellm/config.yaml. Good.
107-108: OPENROUTER_API_KEY reposition is fine.Still wired in Compose and referenced in config. No functional risk.
docker/ai/litellm.yaml (1)
20-20: Env wiring for OPENAI_API_KEY and OPENROUTER_API_KEY looks correct.Defaults are safe, names match .env, and config references are aligned.
Also applies to: 22-22
docker/ai/litellm/config.yaml (1)
42-47: Nice provider docs block.Helpful references; no issues.
b4273d3 to
650ce68
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
config-example/docker/myhost/.env (2)
101-102: Optional: include common OpenAI extras (ORG/PROJECT) as commented placeholdersSome setups use org/project scoping. Consider adding commented lines for quick enablement.
# https://platform.openai.com/settings/organization/api-keys OPENAI_API_KEY="use-some-very-secure-value-here" +## Optional OpenAI scoping (uncomment if you use Org/Project scoping) +# OPENAI_ORG_ID= +# OPENAI_PROJECT_ID=
101-102: dotenv-linter QuoteCharacter warnings: consider unquoting valuesdotenv-linter flags quoted values. To appease it and avoid accidental quotes ending up in runtime envs, prefer unquoted placeholders here.
-OPENAI_API_KEY="use-some-very-secure-value-here" +OPENAI_API_KEY=use-some-very-secure-value-here -OPENROUTER_API_KEY="use-some-very-secure-value-here" +OPENROUTER_API_KEY=use-some-very-secure-value-hereNote: The file currently mixes quoted values elsewhere; if you prefer keeping quotes for consistency, consider disabling the QuoteCharacter rule for example env files in your linter config instead.
Also applies to: 107-108
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
config-example/docker/myhost/.env(1 hunks)docker/ai/litellm.yaml(1 hunks)docker/ai/litellm/config.yaml(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- docker/ai/litellm.yaml
- docker/ai/litellm/config.yaml
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
config-example/docker/myhost/.env
[warning] 102-102: [QuoteCharacter] The value has quote characters (', ")
[warning] 105-105: [QuoteCharacter] The value has quote characters (', ")
[warning] 108-108: [QuoteCharacter] The value has quote characters (', ")
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: check
🔇 Additional comments (3)
config-example/docker/myhost/.env (3)
101-102: OPENAI_API_KEY addition looks good and consistentThe new OpenAI section and comment URL are aligned with the existing provider keys.
107-108: OPENROUTER_API_KEY relocation is fineOrder in .env doesn’t affect Compose env resolution for independent vars. The move increases clarity next to other model providers.
101-102: Env var usage is consistent, but new models aren’t wiredA full‐repo scan shows only the intended OPENAI_API_KEY and OPENROUTER_API_KEY references—no typos or mismatches in:
- docker/ai/litellm.yaml
- docker/ai/litellm/config.yaml
- config-example/docker/myhost/.env
However, I didn’t find any “gpt-5” (or other new‐model) entries in your LiteLLM configs. If you plan to support new models, please update:
- docker/ai/litellm.yaml: add the new model(s) under the openai provider
- docker/ai/litellm/config.yaml: include corresponding model definitions and API‐key wiring
Otherwise, confirm that omitting those entries was intentional.
Summary by CodeRabbit
New Features
Chores