Code Monkey home page Code Monkey logo

genai-rag-primer's Introduction

Gen AI Primer with Gemini

Local setup steps:

  1. Create an account on Google Cloud Platform.

  2. Head over to ai.google.dev and get the Gemini API Key (Save the API somewhere safe for later).

  3. Install Python 3.11 (Refer Python documentation).

  4. Clone the repository and cd inside it,

    $ git clone https://github.com/swarajpande5/genai-rag-primer.git
    $ cd genai-rag-primer
    
  5. Create a virtual environment and activate the same,

    $ python3.11 -m venv venv
    $ source venv/bin/activate
    
  6. Install the project and its dependencies,

    $ pip install -e .
    
  7. Add the GEMINI_API_KEY as the environment variable,

    $ export GEMINI_API_KEY=<PASTE THE API KEY>
    

    OR

    Create a .env file and specify the GEMINI_API_KEY inside it,

    # .env file
    GEMINI_API_KEY=<PASTE THE API KEY>
  8. (Optional) The following environment variables can be specified in the same way as above.

    • CHROMADB_PATH : The path on the local system where Chroma vector database will be created (Default: $HOME/chromadb).

    • COLLECTION_NAME : The name of the collection inside Chroma vector database where vector embeddings will be stored (Default: gemini-rag).

    • GEMINI_EMBEDDING_MODEL : The model which will be used to create embeddings (Default: models/embedding-001).

    • GEMINI_MODEL : The LLM which will be used (Default: gemini-pro).

    • N_RESULTS : The number of relevant results from vector database to fetch, which will be passed to the model later (Default: 3).

      Note: The number of matching embeddings can be less as compared to N_RESULTS.

  9. Start the CLI application,

    $ python3.11 src/__main__.py
    

References

genai-rag-primer's People

Contributors

swarajpande5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.