litellm - 💡(How to fix) Fix LiteLLM doesn't strip double quotes [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#27591Fetched 2026-05-11 03:13:55
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Participants
Timeline (top)
commented ×1labeled ×1

Code Example

docker run \
    -v $(pwd)/litellm_config.yaml:/app/config.yaml \
    --env-file .env \
    -p 4000:4000 \
    docker.litellm.ai/berriai/litellm:main-latest \
    --config /app/config.yaml --detailed_debug

---

$ cat .env

AZURE_API_BASE="https://***.services.ai.azure.com/openai/v1"
AZURE_API_KEY="***"

---

$ cat .env

AZURE_API_BASE=https://***.services.ai.azure.com/openai/v1
AZURE_API_KEY=***
RAW_BUFFERClick to expand / collapse

First try on LiteLLM. Took me a while to figure out how to configure Azure's endpoints when following the tutorial. Claude finally cracked it.

● Found it. The .env file wraps the values in double quotes, and LiteLLM's os.environ/ loader passes those literal " characters into the URL. Removing the quotes fixes it.

NOTE

Using double quotes in a .env file is primarily used to handle whitespace and enable variable expansion (interpolation). While many modern parsers like dotenv and dotenvx automatically strip them, their behavior can change based on the tool or operating system.

Docker: In some versions, using docker run --env-file may preserve the literal quotes as part of the value, which can cause issues with your application code.

MY COMMAND

docker run \
    -v $(pwd)/litellm_config.yaml:/app/config.yaml \
    --env-file .env \
    -p 4000:4000 \
    docker.litellm.ai/berriai/litellm:main-latest \
    --config /app/config.yaml --detailed_debug

WRONG

$ cat .env

AZURE_API_BASE="https://***.services.ai.azure.com/openai/v1"
AZURE_API_KEY="***"

RIGHT

$ cat .env

AZURE_API_BASE=https://***.services.ai.azure.com/openai/v1
AZURE_API_KEY=***

I'd appreciate a note in the tutorial towards this.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix LiteLLM doesn't strip double quotes [1 comments, 2 participants]