Repository navigation
Conversation
Registers frequency as a JSON-configured provider at https://llm.scalefrequency.com/v2 and prices frequency/google/gemma-4-26b-a4b-it, cached input included
snehmehta
requested review from
joshua-berri,
kerry-berri,
mateo-berri and
ryan-crabbe-berri
as code owners
October 28, 2026 10:33
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Resolves append conflicts with kyma, streamlake, clf_ai_gateway and baseten entries added on main: both sides kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The provider raised its reply ceiling for every key from 1,024 to 8,192 tokens (https://docs.miraiminds.co/v2/llm#limits). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
3 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds Frequency as a LiteLLM provider, so people can call its hosted Gemma 4 26B A4B model from the SDK or the proxy and see spend at Frequency's list price. Frequency is a voice-first, India-first inference provider with a low-latency OpenAI-compatible API served from India. I work on Frequency, so this PR comes from the vendor, and we will keep the price row in step with our pricing page
Details
TLDR
Problem this solves:
frequency/prefixfrequency/<model>calls fail before reaching FrequencyHow it solves it:
frequencyas a JSON OpenAI-compatible providerhttps://llm.scalefrequency.com/v2frequency/google/gemma-4-26b-a4b-it, cached input includedUser Flow
Before: a proxy admin who adds a Frequency model gets a 400 on every call, since LiteLLM does not know the
frequency/prefixfrequency/google/gemma-4-26b-a4b-itasgemmawithFREQUENCY_API_KEYand starts the proxy"model": "gemma"to POST http://localhost:4000/v1/chat/completions,/v1/responsesor/v1/messagesThere are no healthy deployments for this modelAfter: the same calls reach Frequency and the model carries Frequency's prices
frequency/google/gemma-4-26b-a4b-itasgemmawithFREQUENCY_API_KEYand starts the proxy"model": "gemma"to POST http://localhost:4000/v1/chat/completions,/v1/responsesor/v1/messageshttps://llm.scalefrequency.com/v2/chat/completions, and a rejected key comes back as Frequency's own 401Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreValidation
Prices come from https://scalefrequency.com/pricing. The base URL, model id and default limits come from https://docs.miraiminds.co/v2/llm#limits
Files changed
litellm/llms/openai_like/providers.jsonregistersfrequencywithFREQUENCY_API_KEY,FREQUENCY_API_BASEand chat completionslitellm/types/utils.pyaddsLlmProviders.FREQUENCYlitellm/constants.pyadds the base URL to the API base detection listmodel_prices_and_context_window.jsonand its backup add the priced rowprovider_endpoints_support.jsonand its backup are regenerated withscripts/generate_provider_endpoints_support.pylitellm/proxy/public_endpoints/provider_create_fields.jsonadds the Add Model entrytests/unit/llms/openai_like/test_frequency_provider.pyis newTests run
tests/unit/llms/openai_like/test_frequency_provider.py, 9 passedtests/unit/llms/openai_like/,tests/unit/test_model_prices_and_context_window.py,tests/unit/test_cost_map_guard.py,tests/unit/litellm_core_utils/test_get_llm_provider_logic.pyandtests/unit/proxy/public_endpoints/test_public_endpoints.py, 543 passedscripts/generate_provider_endpoints_support.py --check,tests/code_coverage_tests/check_provider_folders_documented.pyandtests/code_coverage_tests/test_generate_provider_endpoints_support.pypassruff check,ruff format --checkandscripts/check_test_quality.pyare clean on the new test filebase_urlat/v1turns 7 of the 9 tests redsupports_function_callingoff turns the tools test redmake checkor the type gates locally, so CI is the first run of thoseDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Local proxy with no database, one model, and a fake Frequency key. No paid call was made, so success here means the request reaches Frequency and comes back with Frequency's own 401 instead of LiteLLM failing to resolve the provider.
LITELLM_LOCAL_MODEL_COST_MAP=Truemakes the proxy read the cost map from the checkout, anddisable_cooldownskeeps the first 401 from cooling the deployment down for the next caseBefore (b97fcf1)
The proxy logs
LLM Provider NOT provided ... You passed model=frequency/google/gemma-4-26b-a4b-itat boot and never creates the deploymentchat completions
{"error":{"message":"litellm.BadRequestError: You passed in model=gemma. There are no healthy deployments for this model\n\nLiteLLM: model group 'gemma' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}responses
{"error":{"message":"litellm.BadRequestError: You passed in model=gemma. There are no healthy deployments for this model\n\nLiteLLM: model group 'gemma' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}messages
{"type":"error","error":{"type":"invalid_request_error","message":"litellm.BadRequestError: You passed in model=gemma. There are no healthy deployments for this model\n\nLiteLLM: model group 'gemma' failed with the error above. No fallback was attempted."}}Add Model form
model prices
After (8290c94)
chat completions
{"error":{"message":"litellm.AuthenticationError: FrequencyException - Error code: 401 - {'error': {'code': 'unauthorized', 'message': 'Unknown or invalid key.'}}\n\nLiteLLM: model group 'gemma' failed with the error above. No fallback was attempted.","type":"authentication_error","param":null,"code":"401"}}responses
{"error":{"message":"litellm.AuthenticationError: FrequencyException - Error code: 401 - {'error': {'code': 'unauthorized', 'message': 'Unknown or invalid key.'}}\n\nLiteLLM: model group 'gemma' failed with the error above. No fallback was attempted.","type":"authentication_error","param":null,"code":"401"}}messages
{"type":"error","error":{"type":"authentication_error","message":"litellm.AuthenticationError: FrequencyException - Error code: 401 - {'error': {'code': 'unauthorized', 'message': 'Unknown or invalid key.'}}\n\nLiteLLM: model group 'gemma' failed with the error above. No fallback was attempted."}}Add Model form
{"provider":"FREQUENCY","provider_display_name":"Frequency","litellm_provider":"frequency","credential_fields":[{"key":"api_base","required":false,"placeholder":"https://llm.scalefrequency.com/v2"},{"key":"api_key","required":true,"placeholder":null}],"default_model_placeholder":"frequency/google/gemma-4-26b-a4b-it"}model prices
{"model_name":"gemma","input_cost_per_token":1.5E-7,"cache_read_input_token_cost":9.3E-8,"output_cost_per_token":5.5E-7,"max_input_tokens":32768,"max_output_tokens":1024}Captured before bc24a60. Frequency raised its reply ceiling to 8,192 on 2026-10-31, and the row now says
max_output_tokens: 8192.Type
🆕 New Feature
Caveats (if any)
Medium
docs/providers/frequencyis not in this PRLow
max_output_tokensis 8,192, the most any key can get: a largermax_tokensis lowered to 8,192 (https://docs.miraiminds.co/v2/llm#limits)max_tokensreplies stop at 400 tokens/v1/responsesand/v1/messagesrun through LiteLLM's chat completions bridgefrequency/*wildcard does not list the model in/v1/models, same as other JSON providers without a model setmira-llmas a model id, which has no cost map rowFinal Attestation