Skip to content

Commit 26eea2c

Browse files
committed
feat: add Groq, DeepSeek providers and fix Tokenflux JSON parsing
- Add Groq provider with OpenAI-compatible API support (requires API key) - Add DeepSeek provider using web scraping from documentation - Fix Tokenflux provider JSON parsing by simplifying struct definitions - Update README with comprehensive provider documentation - Add configuration examples for all new providers - Support 8 providers total: PPInfra, OpenRouter, Gemini, Vercel, GitHub AI, Tokenflux, Groq, DeepSeek - Generate updated JSON files for all providers
1 parent 4d40b6f commit 26eea2c

File tree

18 files changed

+8644
-1430
lines changed

18 files changed

+8644
-1430
lines changed

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Access the latest AI model information in JSON format:
1919
- **PPInfra**: [ppinfra.json](dist/ppinfra.json) - PPInfra provider models
2020
- **OpenRouter**: [openrouter.json](dist/openrouter.json) - OpenRouter provider models
2121
- **Google Gemini**: [gemini.json](dist/gemini.json) - Google Gemini API models with web-scraped details
22+
- **Vercel AI Gateway**: [vercel.json](dist/vercel.json) - Vercel AI Gateway hosted models
23+
- **GitHub AI Models**: [github_ai.json](dist/github_ai.json) - GitHub AI Models marketplace
24+
- **Tokenflux**: [tokenflux.json](dist/tokenflux.json) - Tokenflux marketplace models
25+
- **Groq**: [groq.json](dist/groq.json) - Groq hosted models (API key required)
26+
- **DeepSeek**: [deepseek.json](dist/deepseek.json) - DeepSeek models with documentation parsing
2227

2328
## 📦 Installation
2429

@@ -49,7 +54,7 @@ cargo run -- fetch-all -o ./output
4954

5055
Fetch from specific providers:
5156
```bash
52-
cargo run -- fetch-providers -p ppinfra,openai
57+
cargo run -- fetch-providers -p ppinfra,openrouter,groq
5358
```
5459

5560
### CLI Options
@@ -149,6 +154,12 @@ api_url = "https://generativelanguage.googleapis.com/v1beta/openai/models"
149154
api_key_env = "GEMINI_API_KEY" # or use api_key = "your-key"
150155
rate_limit = 10
151156
timeout = 60
157+
158+
[providers.groq]
159+
api_url = "https://api.groq.com/openai/v1/models"
160+
api_key_env = "GROQ_API_KEY"
161+
rate_limit = 10
162+
timeout = 30
152163
```
153164

154165
**🔒 Security Note**: The actual `config/providers.toml` file is ignored by git to prevent accidental API key commits. Always use the example file as a template.
@@ -162,8 +173,8 @@ The tool supports flexible API key configuration with multiple methods and clear
162173
**Method 1: Environment Variables (Recommended)**
163174
```bash
164175
# Only for providers that require API keys
165-
export GEMINI_API_KEY="your-key-here"
166-
# export OPENAI_API_KEY="your-key-here" # When OpenAI provider is added
176+
export GEMINI_API_KEY="your-key-here" # Optional for Gemini (enhances model list)
177+
export GROQ_API_KEY="your-key-here" # Required for Groq
167178
```
168179

169180
**Method 2: Configuration File**
@@ -182,6 +193,12 @@ api_key_env = "GEMINI_API_KEY"
182193
# api_key_env = "MY_CUSTOM_GEMINI_KEY"
183194
# Option C: Direct API key (not recommended for production)
184195
# api_key = "your-gemini-key-here"
196+
197+
[providers.groq]
198+
api_url = "https://api.groq.com/openai/v1/models"
199+
api_key_env = "GROQ_API_KEY"
200+
# Or use direct API key (not recommended)
201+
# api_key = "your-groq-key-here"
185202
```
186203

187204
#### API Key Priority (High to Low)
@@ -199,7 +216,12 @@ This allows you to:
199216

200217
- **PPInfra**: ✅ No API key required - uses public API
201218
- **OpenRouter**: ✅ No API key required - uses public model listing API
219+
- **Vercel AI Gateway**: ✅ No API key required - uses public AI Gateway API
220+
- **GitHub AI Models**: ✅ No API key required - uses public model listing API
221+
- **Tokenflux**: ✅ No API key required - uses public marketplace API
222+
- **DeepSeek**: ✅ No API key required - uses web scraping from documentation
202223
- **Gemini**: ⚠️ Optional API key - uses hybrid web scraping + API approach
224+
- **Groq**: ❌ API key required - private API access only
203225

204226
### Gemini Provider Details
205227

@@ -216,6 +238,21 @@ The Gemini provider implements a unique **hybrid approach**:
216238

217239
**Why Hybrid?** The official Gemini API only provides model names, so web scraping is always required to get comprehensive capability information (vision, function calling, reasoning, context lengths, etc.).
218240

241+
### DeepSeek Provider Details
242+
243+
The DeepSeek provider uses **pure web scraping** from the official [DeepSeek API documentation](https://api-docs.deepseek.com/quick_start/pricing):
244+
245+
**How It Works:**
246+
1. **Documentation Scraping**: Parses model tables from the pricing/models page
247+
2. **Fallback Models**: Uses known model definitions if scraping fails
248+
3. **Capability Detection**: Analyzes model descriptions for feature detection
249+
250+
**Supported Models:**
251+
- **deepseek-chat**: DeepSeek-V3.1 (Non-thinking Mode) with function calling support
252+
- **deepseek-reasoner**: DeepSeek-V3.1 (Thinking Mode) with advanced reasoning capabilities
253+
254+
**Why Web Scraping?** DeepSeek doesn't provide a public model listing API, so documentation parsing ensures we capture the latest model information and specifications.
255+
219256
## 🤖 GitHub Actions Automation
220257

221258
The project includes GitHub Actions workflow with multiple trigger methods:
@@ -293,9 +330,14 @@ For detailed development guide, see [Architecture Documentation](docs/architectu
293330

294331
## 📊 Currently Supported Providers
295332

296-
-**PPInfra** - 38 models with reasoning, function calling, and vision capability detection
333+
-**PPInfra** - 38+ models with reasoning, function calling, and vision capability detection
297334
-**OpenRouter** - 600+ models with comprehensive capability detection and metadata
298335
-**Google Gemini** - Gemini models with hybrid API + web scraping approach for complete metadata
336+
-**Vercel AI Gateway** - 200+ hosted models with pricing and capability information
337+
-**GitHub AI Models** - 50+ models from GitHub's AI marketplace
338+
-**Tokenflux** - 274+ marketplace models with detailed specifications
339+
-**Groq** - 22+ high-performance models (API key required)
340+
-**DeepSeek** - 2 models (deepseek-chat, deepseek-reasoner) with documentation parsing
299341
- 🚧 **OpenAI** - Planned
300342

301343
## 🛠️ Development

config/providers.toml.example

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,34 @@ api_url = "https://tokenflux.ai/v1/models"
5050
rate_limit = 10
5151
timeout = 30
5252

53+
[providers.groq]
54+
api_url = "https://api.groq.com/openai/v1/models"
55+
# Option 1: Use environment variable (recommended for security)
56+
api_key_env = "GROQ_API_KEY"
57+
# Option 2: Direct API key (not recommended for production)
58+
# api_key = "your-groq-key-here"
59+
# Option 3: Use custom environment variable name
60+
# api_key_env = "MY_CUSTOM_GROQ_KEY"
61+
rate_limit = 10
62+
timeout = 30
63+
64+
[providers.deepseek]
65+
api_url = "https://api-docs.deepseek.com/quick_start/pricing"
66+
# DeepSeek uses web scraping from documentation - no API key required
67+
rate_limit = 5
68+
timeout = 60 # Web scraping might take longer
69+
5370
# API Key Configuration Notes:
5471
# - PPInfra: Uses public API, no key required
5572
# - OpenRouter: Uses public model listing API, no key required
5673
# - Vercel: Uses public AI Gateway API, no key required
5774
# - GitHub AI: Uses public model listing API, no key required
5875
# - Tokenflux: Uses public API, no key required
5976
# - Gemini: Optional API key for complete model list
77+
# - Groq: Requires API key for access
78+
# - DeepSeek: Uses web scraping from documentation, no key required
6079
#
6180
# API Key Priority (when applicable):
6281
# 1. Direct API key in config file (api_key)
6382
# 2. Environment variable specified in config (api_key_env)
64-
# 3. Default environment variable (e.g., GEMINI_API_KEY)
83+
# 3. Default environment variable (e.g., GEMINI_API_KEY, GROQ_API_KEY)

0 commit comments

Comments
 (0)