Skip to main content

A unified API interface for Groq and Google's Gemini AI models

Project description

Gemgroq API

A unified API interface that combines both Groq and Google's Gemini AI models into a single, easy-to-use package.

Installation

pip install gemgroq

Setup

After installation, you have two ways to set up your API keys:

  1. Interactive Setup (Recommended):

    gemgroq --setup
    

    This will prompt you for your API keys and save them securely.

  2. Manual Setup:

    • Create a .env file with your API keys:
      GROQ_API_KEY=your_groq_api_key
      GEMINI_API_KEY=your_gemini_api_key
      
    • Or pass them directly in code:
      api = GemgroqAPI(
          groq_api_key="your_groq_api_key",
          gemini_api_key="your_gemini_api_key"
      )
      

Get your API keys from:

Usage

from gemgroq import GemgroqAPI

# Initialize the API (will prompt for keys if not set up)
api = GemgroqAPI()

# Get response from either model
response = api.generate(
    prompt="Tell me a joke",
    model="groq"  # or "gemini"
)

print(response)

Features

  • Unified interface for both Groq and Gemini models
  • Interactive API key setup and secure storage
  • Easy switching between models
  • Consistent response format
  • Error handling and retries
  • Environment variable based configuration

CLI Commands

  • Set up API keys: gemgroq --setup
  • Force update API keys: gemgroq --setup --force

Supported Models

  • Groq: mixtral-8x7b-32768, llama2-70b-4096
  • Gemini: gemini-pro

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

gemgroq-0.1.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

gemgroq-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file gemgroq-0.1.2.tar.gz.

File metadata

  • Download URL: gemgroq-0.1.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for gemgroq-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cbfda72d658ec789ead7ef3d876b42366345fd0819b7c55c688a528d5714cc31
MD5 a88dded707ddc7def6fdc1513d56e42a
BLAKE2b-256 2446ee10990d0b881d8404ac07272a1bb620e642e817ddf94bf053c1a398083f

See more details on using hashes here.

File details

Details for the file gemgroq-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gemgroq-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for gemgroq-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2409981d20a0f318fa6f16899be6137b8d6d8e298c82f3812cb453af87921a9e
MD5 9fc4cd017415de1ac0f2de8fd549d253
BLAKE2b-256 8cde4753191f597951093c5598736b3df0e0197c7eef9dca1b6e29cd5c844e36

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