Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 2.85 KB

README.md

File metadata and controls

70 lines (48 loc) · 2.85 KB

Standalone Examples

This directory contains standalone examples that have a seperate and distinct end-to-end workflow than the examples deployed from the deploy directory of the repository. These examples can have a unique user interface, deployment method, and tools, to showcase different use cases.

RAG in 5 Minutes

This is a simple standalone implementation showing a minimal RAG pipeline that uses models available from NVIDIA API Catalog. The catalog enables you to experience state-of-the-art LLMs accelerated by NVIDIA. Developers get free credits for 10K requests to any of the models.

The example uses an integration package to LangChain to access the models. NVIDIA engineers develop, test, and maintain the open source integration. This example uses a simple Streamlit based user interface and has a one-file implementation. Because the example uses the models from the NVIDIA API Catalog, you do not need a GPU to run the example.

Steps

  1. Create a python virtual environment and activate it:

    python3 -m virtualenv genai
    source genai/bin/activate
    
  2. From the root of this repository, GenerativeAIExamples, install the requirements:

    pip install -r examples/5_mins_rag_no_gpu/requirements.txt
  3. Add your NVIDIA API key as an environment variable:

    export NVIDIA_API_KEY="nvapi-*"

    Refer to Get an API Key for the Mixtral 8x7B Instruct API Endpoint for information about how to get an NVIDIA API key.

  4. Run the example using Streamlit:

    streamlit run examples/5_mins_rag_no_gpu/main.py
  5. Test the deployed example by going to http://<host_ip>:8501 in a web browser.

    Click Browse Files and select your knowledge source. After selecting, click Upload! to complete the ingestion process.

You are all set now! Try out queries related to the knowledge base using text from the user interface.