Skip to content

rajbos/github-models-example

github-models-example

Example repo to use GitHub Models with a RAG example on my blog posts as the data source.

Getting started

To get started with this repositor, open it using a GitHub Codespace. It has all the tools you need to start working with the data and GitHub Models.

After opening the repository in a Codespace, you can run the following command to install the dependencies:

pip install -r requirements.txt

Running the script

To run the script, you can use the following command:

python script.py

Local process

To run the embedding and inference steps on you local machine, start here. This will show you the basic moving parts. The script will execute the following steps:

  • Download and index the data: See lab 1
  • Query the vector store: See lab 2

Using Azure Resources

Now that we have seen the moving parts, we can start leveling up and run this with Azure resources.

  • Use Azure Blob Storage to store the data: See lab 3
  • Use Azure Cognitive Services to create embeddings: See lab 4
  • Use Azure Machine Learning to run the inference

Running the scripts

  1. Look at the scripts for the documented parameters on the top
  2. Configure the necesary environment variables (also see .env-example that can be copied to .env and filled in)
  3. Run the download of the dependencies with pip install -r requirements.txt
  4. Run the scripts one by one with python <script-name>.py

Extra information

All along the way, the most interesting durationss for each step is shown to give you an idea of the performance of the script. At the end of the script, the used API requests to GitHub Models are printed, together with the information about the used tokens, as this is all dependent on the rate limit for GitHub Models.

About

Example repo to use GitHub Models with RAG

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages