tokenfirewall
tokenfirewall copied to clipboard
Enhancement: Add Groq API Support to Provider Adapters
Description
TokenFirewall currently supports major providers like OpenAI and Gemini. However, as developers increasingly adopt high-speed inference engines like Groq for specific routing fallbacks, adding native support for Groq would significantly enhance the middleware's flexibility and multi-provider capabilities.
Proposed Solution
- Create a new
GroqAdapterclass in the adapters directory that implements the standard provider interface. - Map Groq's API request/response structures (which are largely OpenAI-compatible) to the internal TokenFirewall data format.
- Add Groq pricing logic to the token counting and budget enforcement modules.
- Update the
README.mdto include an example of initializing the firewall with a Groq API key.
GSSoC '26 Request
Hi maintainers! 👋 I am actively participating in GirlScript Summer of Code 2026 and would love to build this feature.
Could you please:
- Assign this issue to me.
- Add the
gssoc26,enhancement, andhacktoberfest(if applicable) labels to this issue
Thank you! I am ready with the solution and I look forward to contributing.