Back to skills
SKILL.md
2930 Custom Providers A31fe83a
ASecuritygptme supports configuring multiple custom OpenAI-compatible providers (completions API) in addition to the built-in providers (openai, openrouter, etc.).
- 9 stars
- 0 votes
- 0 copies
- 0 views
- Added October 11, 2026
Works with
Security analysis
100/100npx -y skills add tools-only/X-Skills --skill 2930-custom-providers_a31fe83a --agent claude-codeAre you the author of 2930 Custom Providers A31fe83a?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-2930-custom-providers-a31fe83a)# Custom Providers
gptme supports configuring multiple custom OpenAI-compatible providers (completions API) in addition to the built-in providers (openai, openrouter, etc.).
## Configuration
Add custom providers to your `~/.config/gptme/config.toml`:
```toml
[[providers]]
name = "vllm-local"
base_url = "http://localhost:8000/v1"
default_model = "meta-llama/Llama-3.1-8B"
[[providers]]
name = "azure-gpt4"
base_url = "https://my-azure-endpoint.openai.azure.com/openai/deployments"
api_key_env = "AZURE_API_KEY"
default_model = "gpt-4"
[[providers]]
name = "groq"
base_url = "https://api.groq.com/openai/v1"
api_key_env = "GROQ_API_KEY"
default_model = "llama-3.1-70b-versatile"
```
### Configuration Fields
- `name` (required): Provider identifier used in model selection
- `base_url` (required): Base URL for the OpenAI-compatible API
- `api_key` (optional): API key directly in config (not recommended)
- `api_key_env` (optional): Environment variable name containing the API key
- `default_model` (optional): Default model when only provider name is specified
### API Key Resolution
The API key is resolved in this priority order:
1. **Direct value**: `api_key = "key-here"` (not recommended for security)
2. **Environment variable**: `api_key_env = "MY_API_KEY"`
3. **Default convention**: `${PROVIDER_NAME}_API_KEY` (e.g., `GROQ_API_KEY` for provider named "groq")
## Usage
### With CLI
```bash
# Use specific custom provider with model
gptme --model vllm-local/my-model "query"
# Use custom provider with default model
gptme --model azure-gpt4 "query"
# List configured providers
gptme-util providers list
```
### Provider Listing
```bash
$ gptme-util providers list
π Found 3 custom provider(s):
π‘ vllm-local
Base URL: http://localhost:8000/v1
API Key: $VLLM_LOCAL_API_KEY (default)
Default Model: meta-llama/Llama-3.1-8B
π‘ azure-gpt4
Base URL: https://my-azure-endpoint.openai.azure.com/openai/deployments
API Key: $AZURE_API_KEY
Default Model: gpt-4
π‘ groq
Base URL: https://api.groq.com/openai/v1
API Key: $GROQ_API_KEY
Default Model: llama-3.1-70b-versatile
```
## Backward Compatibility
The existing `local` provider continues to work using the `OPENAI_BASE_URL` and `OPENAI_API_KEY` environment variables. No changes are required for existing configurations.
## Implementation Details
### Phase 1 (Completed)
- β
Configuration schema (`ProviderConfig` dataclass)
- β
TOML parsing in `load_user_config()`
- β
Provider initialization in `llm_openai.py`
- β
`gptme-util providers list` command
- β
Backward compatibility with `local` provider
- β
API key resolution with priority order
### Phase 2 (Planned)
- [ ] Model selection updates for `provider/model` syntax
- [ ] Provider registry for managing custom providers
- [ ] Integration tests with mock providers
### Phase 3 (Planned)
- [ ] Complete documentation with examples
- [ ] User guide for common provider configurations
- [ ] Migration guide from `local` provider
## Examples
### Local vLLM Server
```toml
[[providers]]
name = "vllm-local"
base_url = "http://localhost:8000/v1"
default_model = "meta-llama/Llama-3.1-8B"
```
```bash
export VLLM_LOCAL_API_KEY="none" # vLLM doesn't require auth
gptme --model vllm-local "What is the capital of France?"
```
### Groq Cloud
```toml
[[providers]]
name = "groq"
base_url = "https://api.groq.com/openai/v1"
api_key_env = "GROQ_API_KEY"
default_model = "llama-3.1-70b-versatile"
```
```bash
export GROQ_API_KEY="gsk_..."
gptme --model groq "Explain quantum computing"
```
### Azure OpenAI
```toml
[[providers]]
name = "azure-gpt4"
base_url = "https://my-endpoint.openai.azure.com/openai/deployments"
api_key_env = "AZURE_API_KEY"
default_model = "gpt-4"
```
```bash
export AZURE_API_KEY="..."
gptme --model azure-gpt4 "Write a Python function to sort a list"
```
## Related
- [Issue #673](https://github.com/gptme/gptme/issues/673) - Original feature request
- [Issue #514](https://github.com/gptme/gptme/issues/514) - Requesty provider support
- [Issue #548](https://github.com/gptme/gptme/issues/548) - AI/ML provider support
- [Issue #555](https://github.com/gptme/gptme/issues/555) - Chutes provider support
Attribution
Comments
Loading commentsβ¦
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.