litellm - ✅(Solved) Fix [Bug]: Fireworks "v1" duplication issue [1 pull requests, 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#23106Fetched 2026-04-08 00:38:33
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Timeline (top)
labeled ×3referenced ×3closed ×1commented ×1

Error Message

When running the LiteLLM proxy server with Fireworks AI models configured, the proxy's /v1/models endpoint triggers an internal call to fetch available models from Fireworks AI. This call constructs a malformed URL with a duplicated /v1 path segment, resulting in a 404 error. LiteLLM:WARNING: utils.py:7202 - Error getting valid models: Failed to fetch models from Fireworks AI. Status code: 404, Response: {'error': {'message': 'Path not found: /v1/v1/accounts/fireworks/models', 'param': None, 'code': 'NOT_FOUND', 'type': 'error'}}

Fix Action

Fixed

PR fix notes

PR #23113: fix(fireworks): strip duplicate /v1 from models endpoint URL

Description (problem / solution / changelog)

Description

Fix the doubled /v1 path segment in the Fireworks AI models endpoint URL.

_get_openai_compatible_provider_info returns api_base defaulting to https://api.fireworks.ai/inference/v1, but get_models constructs the URL as:

url=f"{api_base}/v1/accounts/{account_id}/models"

This produces https://api.fireworks.ai/inference/v1/v1/accounts/... which returns a 404.

The fix strips any trailing /v1 from api_base before re-adding the full path, so both the default base and user-supplied bases work correctly.

Fixes #23106

Changes

  • litellm/llms/fireworks_ai/chat/transformation.py: Strip trailing /v1 from api_base in get_models before constructing the URL

Changed files

  • litellm/llms/fireworks_ai/chat/transformation.py (modified, +4/-1)
  • tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py (modified, +54/-0)

Code Example

url=f"{api_base}/v1/accounts/{account_id}/models"

---

curl http://localhost:4000/v1/models

---

LiteLLM:WARNING: utils.py:7202 - Error getting valid models: Failed to fetch models from Fireworks AI. Status code: 404, Response: {'error': {'message': 'Path not found: /v1/v1/accounts/fireworks/models', 'param': None, 'code': 'NOT_FOUND', 'type': 'error'}}
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When running the LiteLLM proxy server with Fireworks AI models configured, the proxy's /v1/models endpoint triggers an internal call to fetch available models from Fireworks AI. This call constructs a malformed URL with a duplicated /v1 path segment, resulting in a 404 error.

The _get_openai_compatible_provider_info method in litellm/llms/fireworks_ai/chat/transformation.py sets api_base to https://api.fireworks.ai/inference/v1, but get_models then constructs the URL as:

url=f"{api_base}/v1/accounts/{account_id}/models"

This produces https://api.fireworks.ai/inference/v1/v1/accounts/fireworks/models — note the doubled /v1/v1.

This is the same class of bug as #3346 (Double /v1/v1 on OpenAI requests with api_base), but occurring in the Fireworks AI model-fetching code path.

Steps to Reproduce

  1. Configure the LiteLLM proxy with a Fireworks AI model and a valid FIREWORKS_API_KEY.
  2. Start the proxy server.
  3. Request the models endpoint:
    curl http://localhost:4000/v1/models
  4. Observe the warning in the proxy server logs due to the duplicated /v1 in the upstream request URL to Fireworks AI.

Relevant log output

LiteLLM:WARNING: utils.py:7202 - Error getting valid models: Failed to fetch models from Fireworks AI. Status code: 404, Response: {'error': {'message': 'Path not found: /v1/v1/accounts/fireworks/models', 'param': None, 'code': 'NOT_FOUND', 'type': 'error'}}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.81.14

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To fix the issue, we need to remove the duplicated /v1 path segment from the URL constructed in the get_models method.

  • Update the get_models method in litellm/llms/fireworks_ai/chat/transformation.py to remove the extra /v1:
url = f"{api_base}/accounts/{account_id}/models"

Alternatively, you can use the urllib.parse.urljoin function to construct the URL, which will handle the path joining correctly:

import urllib.parse

url = urllib.parse.urljoin(api_base, f"/accounts/{account_id}/models")

Verification

To verify that the fix worked, follow these steps:

  • Restart the LiteLLM proxy server
  • Request the models endpoint again:
curl http://localhost:4000/v1/models
  • Check the proxy server logs for any warnings or errors related to the duplicated /v1 path segment. The warning should be gone, and the models should be fetched successfully.

Extra Tips

  • Make sure to test the fix thoroughly to ensure that it doesn't introduce any new issues.
  • Consider adding a test case to cover this scenario to prevent regressions in the future.

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