This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
2.4.0
Gemini-API v2.4.0
This release includes various bug fixes and new features.
What's changed?
- Adding temporary free access to open-source LLM APIs. Stably use Google's Gemma for free.
- [Example codes] (Free limit: 10 requests/minute)
Installation 📦
pip install python-gemini-api==2.4.0
Utilize free open-source LLM API through Open Router in Gemini-API
OpenRouter offers temporary free inference for select models. Obtain an API key from Open Router API and check free models at Open Router models. Use models with a 0-dollar token cost primarily; other models may incur charges. See more free open-source LLM API guide
from gemini import OpenRouter
OPENROUTER_API_KEY = "<your_open_router_api_key>"
GemmaClient = OpenRouter(api_key=OPENROUTER_API_KEY, model="google/gemma-7b-it:free")
prompt = "Do you know UCA academy in Korea? https://blog.naver.com/ulsancoding"
response = GemmaClient.create_chat_completion(prompt)
print(response)
# payload = GemmaClient.generate_content(prompt)
# print(payload.json())
The free model list includes:
google/gemma-7b-it:free
- google/gemma-7b from Google ***mistralai/mistral-7b-instruct:free
- mistralai/Mistral-7B-Instruct-v0.1 for instruction from Mistral AI ****huggingfaceh4/zephyr-7b-beta:free
-HuggingFaceH4/zephyr-7b-beta ***openchat/openchat-7b:free
- openchat/openchat for chat **openrouter/cinematika-7b:free
- jondurbin/cinematika-7b-v0.1undi95/toppy-m-7b:free
- Undi95/Toppy-M-7Bgryphe/mythomist-7b:free
- Gryphe/MythoMist-7bnousresearch/nous-capybara-7b:free
- NousResearch/Nous-Capybara-7B-V1 from Nous Research
Note
You can easily receive responses from open LLMs without this package by following the instructions on here.