Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
doc: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark authored May 2, 2024
1 parent 27f3a56 commit 86d56dd
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ On the official side, Google provides partially free, clean [official Gemini API
## Contents

- [ Gemini API ](#-gemini-api---)
- [What is Gemini? 🔐](#what-is-gemini)
- [What is Gemini? 🔒](#what-is-gemini)
- [What is Python-Gemini-API? 🔐](#what-is-python-gemini-api)
- [Installation ✅](#installation-)
- [Authentication ✅](#authentication)
- [Quick Start ✅](#quick-start)
Expand All @@ -54,7 +55,8 @@ On the official side, Google provides partially free, clean [official Gemini API
- [# 10. Changing the Selected Response from 0 to *n*](#-10-changing-the-selected-response-from-0-to-n)
- [# 11. Generate custom content](#-11-generate-custom-content)
- [Further](#further)
- [Google Open-source LLMs](#google-open-source-llms)
- [Google Proprietary LLM, Gemini 🔒](#google-proprietary-llm-gemini)
- [Google Open-source LLMs 🤝](#google-open-source-llms)
- [Open-source LLM, Gemma 🤝](#open-source-llm-gemma)
- [Open-source LLM, Code Gemma 🤝](#open-source-llm-code-gemma)
- [Utilize free open-source LLM API through Open Router ✅](#utilize-free-open-source-llm-api-through-open-router)
Expand Down Expand Up @@ -625,15 +627,38 @@ If you want to develop your own simple code, you can start from [this simple cod

<br>

---

<br>

## Google Proprietary LLM, [Gemini](https://gemini.google.com/app)

#### Official API

Prepare necessary items and obtain an API key at [Google AI Studio](https://aistudio.google.com/app/apikey). Install on Python 3.9 or higher and enter the issued API key. Refer to the [tutorial](https://ai.google.dev/gemini-api/docs/get-started/python) for details.

```
pip install -q -U google-generativeai
```
```python
import google.generativeai as genai

GOOGLE_API_KEY="<your_gemini_api_key>"
genai.configure(api_key=GOOGLE_API_KEY)

model = genai.GenerativeModel('gemini-pro')
response = model.generate_content("Write me a poem about Machine Learning.")

print(response.text)
```

## Google Open-source LLMs

If you have sufficient GPU resources, you can download weights directly instead of using the Gemini API to generate content. Consider Gemma and Code Gemma, an open-source models **available for on-premises use**.



### Open-source LLM, [Gemma](https://huggingface.co/google/gemma-7b)


Gemma models are Google's lightweight, advanced text-to-text, decoder-only language models, derived from Gemini research. Available in English, they offer open weights and variants, ideal for tasks like question answering and summarization. For more infomation, visit [Gemma-7b](https://huggingface.co/google/gemma-7b) model card.

#### How to use Gemma
Expand Down Expand Up @@ -670,6 +695,10 @@ print(tokenizer.decode(outputs[0]))



<br>

---

<br>


Expand Down Expand Up @@ -704,8 +733,6 @@ The free model list includes:





<br>

## Sponsor
Expand Down

0 comments on commit 86d56dd

Please sign in to comment.