This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
2.4.2
Gemini-API v2.4.2
Error fixed.
pip install python-gemini-api==2.4.2
pip install -q -U python-gemini-api
What's changed?
- You can use gemini-advanced version by declaring env variable. (Experimental feature)
import os os.environ["GEMINI_ULTRA"] = "1"
- Error fix #24
- New feature from 2.4.0
[See Code Examples]
Check out temporarily free Open-source LLM APIs with Open Router. (Free limit: 10 requests/minute)
Utilize free open-source LLM API through Open Router
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
Note
You can easily receive responses from open LLMs without this package by following the instructions on here.
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