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:
-
Interactive Setup (Recommended):
gemgroq --setupThis will prompt you for your API keys and save them securely.
-
Manual Setup:
- Create a
.envfile 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" )
- Create a
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gemgroq-0.1.1.tar.gz.
File metadata
- Download URL: gemgroq-0.1.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b1054b1d02f7d52daf12768c66ebc07095ae3a4ba0613ec5dc876050943b87b
|
|
| MD5 |
e6488b0b4f0da2d1ecfc06ea815e91dd
|
|
| BLAKE2b-256 |
c755c754baac4cf32914b1bdc8d7aae33dda091b0032ccd62d6b482593af3827
|
File details
Details for the file gemgroq-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gemgroq-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3b9f7df4cbfc23a2dbbc32cb53e5203cb4ec2ce1154867d3e4b93602d06dfbd
|
|
| MD5 |
50a6780af7e3b651fe7399542e51aa6f
|
|
| BLAKE2b-256 |
175e8591843ebb98ae59b3ecb5781f03af9cb452b690411ba9267f0a6efe1f0c
|