Skip to main content

Test API keys for multiple LLM providers

Project description

🔥 Keyforge

Test API keys for multiple LLM providers with confidence.

Features

  • Config-driven: Provider URLs and settings in JSON
  • CLI arguments: Test specific models or providers
  • Multi-provider: Supports 6+ LLM providers out of the box
  • UV optimized: Fast dependency management

Installation

git clone <repository-url>
cd keyforge

# Install dependencies
uv sync
# or: pip install -r requirements.txt

# Setup environment
cp .env.sample .env
# Edit .env with your actual API keys

Usage

Development (Local)

# Test all models
uv run keyforge.py

# Test specific model
uv run keyforge.py model1

# Test multiple models  
uv run keyforge.py model1 model3

# Test by provider
uv run keyforge.py --provider anthropic

# List available models
uv run keyforge.py --list

# Show help
uv run keyforge.py --help

Installed Package

# Install globally
pip install keyforge

# Use the CLI command
keyforge model1
keyforge --provider anthropic
keyforge --list

Configuration

API Keys (.env)

ANTHROPIC_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
GOOGLE_API_KEY=your_key_here
PERPLEXITY_API_KEY=your_key_here
OPENROUTER_API_KEY=your_key_here
XAI_API_KEY=your_key_here

Models (config.json)

{
  "providers": {
    "anthropic": {
      "url": "https://api.anthropic.com/v1/messages",
      "apiKeyEnv": "ANTHROPIC_API_KEY",
      "authHeader": "x-api-key"
    }
  },
  "models": {
    "model1": {
      "provider": "anthropic",
      "modelId": "claude-sonnet-4-20250514",
      "maxTokens": 1000,
      "temperature": 0.2
    }
  }
}

Supported Providers

  • Anthropic - Claude models
  • OpenAI - GPT and O-series models
  • Google - Gemini models
  • Perplexity - Search-enhanced AI
  • OpenRouter - Multi-model aggregator
  • XAI - Grok models

Adding New Providers

Add to the providers section in config.json:

"newprovider": {
  "url": "https://api.example.com/v1/chat",
  "apiKeyEnv": "NEW_PROVIDER_API_KEY",
  "headers": {"Content-Type": "application/json"},
  "authHeader": "Authorization",
  "authPrefix": "Bearer ",
  "responseField": "choices[0].message.content"
}

Security

⚠️ Never commit .env files to version control

  • .env.sample - Safe template with placeholders
  • .env - Contains actual API keys (git-ignored)

Files

File Description Safe to Share
keyforge.py Main script
config.json Configuration
.env.sample Key template
.env Actual keys

Dependencies

  • requests - HTTP client
  • python-dotenv - Environment variables
  • Python 3.8+

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keyforge-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keyforge-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file keyforge-0.1.0.tar.gz.

File metadata

  • Download URL: keyforge-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for keyforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d0cc5e8e0ab1708f327473bd0a01b6cff081c974d50a720caad10f13405af1b5
MD5 ab57ec8506eebae447952ca4afe67fb2
BLAKE2b-256 7a579ce60343a37ecbecfb0bb775dd1e360606810db1c2e7ae5df25b97641604

See more details on using hashes here.

File details

Details for the file keyforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: keyforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for keyforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aed7207eaf595e96e9abb4390bd36a78d4aebd80f21a0ae1accb2605089254f0
MD5 e878c8f037079e4130b12d1ccd40992a
BLAKE2b-256 bdbb6f0198e1eea9c21c6f7c37bf830aff572fc1c8e73c1a12f8072c1bbea4e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page