-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e234587
commit 79708fe
Showing
24 changed files
with
450 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# AWS Bedrock | ||
|
||
> Note: Fork and clone this repository if needed | ||
### 1. Create and activate a virtual environment | ||
|
||
```shell | ||
python3 -m venv ~/.venvs/aienv | ||
source ~/.venvs/aienv/bin/activate | ||
``` | ||
|
||
### 2. Export your AWS Credentials | ||
|
||
```shell | ||
export AWS_ACCESS_KEY_ID=*** | ||
export AWS_SECRET_ACCESS_KEY=*** | ||
``` | ||
|
||
### 3. Install libraries | ||
|
||
```shell | ||
pip install -U boto3 phidata | ||
``` | ||
|
||
### 4. Run Assistant | ||
|
||
- stream on | ||
|
||
```shell | ||
python cookbook/llms/bedrock/basic.py | ||
``` | ||
|
||
- stream off | ||
|
||
```shell | ||
python cookbook/llms/bedrock/basic_stream_off.py | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from phi.assistant import Assistant | ||
from phi.llm.aws.claude import Claude | ||
|
||
assistant = Assistant( | ||
llm=Claude(model="anthropic.claude-v2"), | ||
description="You help people with their health and fitness goals.", | ||
debug_mode=True, | ||
) | ||
assistant.print_response("Share a quick healthy breakfast recipe.", markdown=True, stream=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from phi.assistant import Assistant | ||
from phi.llm.anthropic import Claude | ||
|
||
assistant = Assistant( | ||
llm=Claude(model="claude-3-haiku-20240307"), | ||
description="You help people with their health and fitness goals.", | ||
) | ||
assistant.print_response("Share a quick healthy breakfast recipe.", markdown=True, stream=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# RAG with Groq & PgVector | ||
|
||
> Note: Fork and clone this repository if needed | ||
### 1. Create a virtual environment | ||
|
||
```shell | ||
python3 -m venv ~/.venvs/aienv | ||
source ~/.venvs/aienv/bin/activate | ||
``` | ||
|
||
### 2. Export your Groq & OpenAI API Key | ||
|
||
> Need to use OpenAI for embeddings as Groq doesn't support embeddings yet. | ||
```shell | ||
export GROQ_API_KEY=*** | ||
export OPENAI_API_KEY=sk-*** | ||
``` | ||
|
||
### 3. Install libraries | ||
|
||
```shell | ||
pip install -r cookbook/llms/groq/rag/requirements.txt | ||
``` | ||
|
||
### 4. Run PgVector | ||
|
||
> Install [docker desktop](https://docs.docker.com/desktop/install/mac-install/) first. | ||
- Run using a helper script | ||
|
||
```shell | ||
./cookbook/run_pgvector.sh | ||
``` | ||
|
||
- OR run using the docker run command | ||
|
||
```shell | ||
docker run -d \ | ||
-e POSTGRES_DB=ai \ | ||
-e POSTGRES_USER=ai \[app.py](..%2Fapp.py) | ||
-e POSTGRES_PASSWORD=ai \ | ||
-e PGDATA=/var/lib/postgresql/data/pgdata \ | ||
-v pgvolume:/var/lib/postgresql/data \ | ||
-p 5532:5432 \ | ||
--name pgvector \ | ||
phidata/pgvector:16 | ||
``` | ||
|
||
### 5. Run RAG App | ||
|
||
```shell | ||
streamlit run cookbook/llms/groq/rag/app.py | ||
``` | ||
|
||
- Open [localhost:8501](http://localhost:8501) to view your RAG app. | ||
|
||
### 6. Message on [discord](https://discord.gg/4MtYHHrgA8) if you have any questions | ||
|
||
### 7. Star ⭐️ the project if you like it. |
Empty file.
Oops, something went wrong.