Skip to content

feat(providers): add Frequency provider (OpenAI-compatible, Gemma 4 26B A4B) - #48795

Open
snehmehta wants to merge 4 commits into
BerriAI:mainfrom
snehmehta:add-frequency-provider
Open

snehmehta wants to merge 4 commits into
BerriAI:mainfrom
snehmehta:add-frequency-provider

Conversation

@snehmehta

@snehmehta snehmehta commented Oct 28, 2026 •

Copy link
Copy Markdown

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:

  • LiteLLM does not know the frequency/ prefix
  • frequency/<model> calls fail before reaching Frequency
  • Frequency usage has no price, so spend reads $0

How it solves it:

  • Registers frequency as a JSON OpenAI-compatible provider
  • Sends chat completions to https://llm.scalefrequency.com/v2
  • Prices frequency/google/gemma-4-26b-a4b-it, cached input included
  • Detects Frequency from its API base alone
  • Lists Frequency in the Add Model form and endpoint matrix

User Flow

Before: a proxy admin who adds a Frequency model gets a 400 on every call, since LiteLLM does not know the frequency/ prefix

  1. The admin adds frequency/google/gemma-4-26b-a4b-it as gemma with FREQUENCY_API_KEY and starts the proxy
  2. GET http://localhost:4000/public/providers/fields has no Frequency entry for the Add Model form
  3. A developer sends "model": "gemma" to POST http://localhost:4000/v1/chat/completions, /v1/responses or /v1/messages
  4. Each one answers 400 There are no healthy deployments for this model

After: the same calls reach Frequency and the model carries Frequency's prices

  1. The admin adds frequency/google/gemma-4-26b-a4b-it as gemma with FREQUENCY_API_KEY and starts the proxy
  2. GET http://localhost:4000/public/providers/fields lists Frequency with API key and API base fields
  3. A developer sends "model": "gemma" to POST http://localhost:4000/v1/chat/completions, /v1/responses or /v1/messages
  4. Each one reaches https://llm.scalefrequency.com/v2/chat/completions, and a rejected key comes back as Frequency's own 401
  5. GET http://localhost:4000/model/info shows $0.15/1M input, $0.093/1M cached input and $0.55/1M output

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. 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 more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Validation

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.json registers frequency with FREQUENCY_API_KEY, FREQUENCY_API_BASE and chat completions
  • litellm/types/utils.py adds LlmProviders.FREQUENCY
  • litellm/constants.py adds the base URL to the API base detection list
  • model_prices_and_context_window.json and its backup add the priced row
  • provider_endpoints_support.json and its backup are regenerated with scripts/generate_provider_endpoints_support.py
  • litellm/proxy/public_endpoints/provider_create_fields.json adds the Add Model entry
  • tests/unit/llms/openai_like/test_frequency_provider.py is new

Tests run

  • tests/unit/llms/openai_like/test_frequency_provider.py, 9 passed
  • tests/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.py and tests/unit/proxy/public_endpoints/test_public_endpoints.py, 543 passed
  • scripts/generate_provider_endpoints_support.py --check, tests/code_coverage_tests/check_provider_folders_documented.py and tests/code_coverage_tests/test_generate_provider_endpoints_support.py pass
  • ruff check, ruff format --check and scripts/check_test_quality.py are clean on the new test file
  • Mutation check
    • Pointing base_url at /v1 turns 7 of the 9 tests red
    • Dropping the base URL from the detection list turns the detection test red
    • Turning supports_function_calling off turns the tools test red
    • Dropping the cached input price turns the cost test red
  • I did not run make check or the type gates locally, so CI is the first run of those

Delays 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=True makes the proxy read the cost map from the checkout, and disable_cooldowns keeps the first 401 from cooling the deployment down for the next case

model_list:
  - model_name: gemma
    litellm_params:
      model: frequency/google/gemma-4-26b-a4b-it
      api_key: os.environ/FREQUENCY_API_KEY
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
router_settings:
  disable_cooldowns: true
export FREQUENCY_API_KEY=not-a-real-frequency-key LITELLM_LOCAL_MODEL_COST_MAP=True LITELLM_MASTER_KEY=<local key>
python -m litellm.proxy.proxy_cli --config frequency_proxy_config.yaml --port 4000 --num_workers 1

Before (b97fcf1)

The proxy logs LLM Provider NOT provided ... You passed model=frequency/google/gemma-4-26b-a4b-it at boot and never creates the deployment

chat completions

  1. Run
curl -s localhost:4000/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' \
  -d '{"model":"gemma","messages":[{"role":"user","content":"Say hello"}]}'
  1. HTTP 400
{"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

  1. Run
curl -s localhost:4000/v1/responses -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' \
  -d '{"model":"gemma","input":"Say hello"}'
  1. HTTP 400
{"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

  1. Run
curl -s localhost:4000/v1/messages -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' \
  -H 'anthropic-version: 2023-06-01' -d '{"model":"gemma","max_tokens":32,"messages":[{"role":"user","content":"Say hello"}]}'
  1. HTTP 400
{"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

  1. Run
curl -s localhost:4000/public/providers/fields -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  | jq -c '.[] | select(.litellm_provider == "frequency") | {provider, provider_display_name, litellm_provider, credential_fields: [.credential_fields[] | {key, required, placeholder}], default_model_placeholder}'
  1. Empty output, no Frequency entry

model prices

  1. Run
curl -s localhost:4000/model/info -H "Authorization: Bearer $LITELLM_MASTER_KEY" \
  | jq -c '.data[] | {model_name, input_cost_per_token: .model_info.input_cost_per_token, cache_read_input_token_cost: .model_info.cache_read_input_token_cost, output_cost_per_token: .model_info.output_cost_per_token, max_input_tokens: .model_info.max_input_tokens, max_output_tokens: .model_info.max_output_tokens}'
  1. Empty output, the model never loaded

After (8290c94)

chat completions

  1. Run the same chat completions curl
  2. HTTP 401 from Frequency
{"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

  1. Run the same responses curl
  2. HTTP 401 from Frequency, through LiteLLM's chat completions bridge since Frequency only serves 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"}}

messages

  1. Run the same messages curl
  2. HTTP 401 from Frequency, through the same bridge
{"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

  1. Run the same fields curl
  2. Frequency is listed
{"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

  1. Run the same model info curl
  2. The model carries Frequency's prices and limits
{"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

  • No paid call in the proof, it stops at Frequency's 401
    • The cached token cost math is covered by a unit test
  • Docs page docs/providers/frequency is not in this PR
    • The endpoint matrix links there like other providers, so it needs a litellm-docs PR

Low

  • max_output_tokens is 8,192, the most any key can get: a larger max_tokens is lowered to 8,192 (https://docs.miraiminds.co/v2/llm#limits)
    • Without max_tokens replies stop at 400 tokens
    • A request holds up to 100 messages, 16,000 characters of message text and 16 tools
    • Context is 32,768 tokens
  • /v1/responses and /v1/messages run through LiteLLM's chat completions bridge
  • A frequency/* wildcard does not list the model in /v1/models, same as other JSON providers without a model set
  • Frequency also accepts mira-llm as a model id, which has no cost map row

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

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
@codspeed

codspeed Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 35 untouched benchmarks


Comparing snehmehta:add-frequency-provider (8290c94) with main (b97fcf1)

Open in CodSpeed

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

bysnehmehta and others added 3 commits October 30, 2026 19:46
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>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants