Fast Start: Learning RAG with llmware through 6 examples
Welcome to llmware!
Fast Start is a structured series of 6 self-contained examples and accompanying videos that walk through the core foundational components of RAG with LLMWare.
Set up
pip3 install llmware
or, if you prefer clone the github repo locally, e.g., git clone git@github.com:llmware-ai/llmware.git
.
Platforms:
- Mac M1/M2/M3, Windows, Linux (Ubuntu 20 or Ubuntu 22 preferred)
- RAM: 16 GB minimum
- Python 3.9, 3.10, 3.11, 3.12
- Pull the latest version of llmware == 0.2.14 (as of mid-May 2024)
- Please note that we have updated the examples from the original versions, to use new features in llmware, so there may be minor differences with the videos, which are annotated in the comments in each example.
There are 6 examples, designed to be used step-by-step, but each is self-contained,
so you can feel free to jump into any of the examples, in any order, that you prefer.
Each example has been designed to be “copy-paste” and RUN with lots of helpful comments and explanations embedded in the code samples.
Please check out our Fast Start Youtube tutorials that walk through each example below.
Examples:
Section I - Learning the Main Components
-
Library - parse, text chunk, and index to convert a “pile of files” into an AI-ready knowledge-base. Video
-
Embeddings - apply an embedding model to the Library, store vectors, and start enabling natural language queries. Video
-
Prompts & Model Catalog - start running inferences and building prompts. Video
Section II - Connecting Knowledge with Prompts - 3 scenarios
-
RAG with Text Query - start integrating documents into prompts. Video
-
RAG with Semantic Query - use natural language queries on documents and integrate with prompts. Video
-
RAG with more complex retrieval - start integrating more complex retrieval patterns. Video
After completing these 6 examples, you should have a good foundation and set of recipes to start exploring the other 100+ examples in the /examples folder, and build more sophisticated LLM-based applications.
Models
- All of these examples are optimized for using local CPU-based models, primarily BLING and DRAGON.
- If you want to substitute for any other model in the catalog, it is generally as easy as switching the model_name. If the model requires API keys, we show in the examples how to pass those keys as an environment variable.
Collection Databases
- Our parsers are optimized to index text chunks directly into a persistent data store.
- For Fast Start, we will use “sqlite” which is an embedded database, requiring no install
- For more scalable deployment, we would recommend either “mongo” or “postgres”
- Install instructions for “mongo” and “postgres” are provided in docker-compose files in the repository
Vector Databases
- For Fast Start, we will use “chromadb” in persistent ‘file’ mode, requiring no install.
- Note: if you are using Python < 3.12, then please feel free to substitute for faiss (which was used in the videos).
- Note: depending upon how and when you installed llmware, you may need to
pip install chromadb
. - For more scalable deployment, we would recommend installing one of 9 supported vector databases, including Milvus, PGVector (Postgres), Redis, Qdrant, Neo4j, Mongo-Atlas, Chroma, LanceDB, or Pinecone.
- Install instructions provided in “examples/Embedding” for specific db, as well as docker-compose scripts.
Local Private - All of the processing will take place locally on your laptop.
This is an ongoing initiative to provide easy-to-get-started tutorials - we welcome and encourage feedback, as well as contributions with examples and other tips for helping others on their LLM application journeys!
Let’s get started!
More information about the project - see main repository
About the project
llmware
is © 2023-2024 by AI Bloks.
Contributing
Please first discuss any change you want to make publicly, for example on GitHub via raising an issue or starting a new discussion. You can also write an email or start a discussion on our Discrod channel. Read more about becoming a contributor in the GitHub repo.
Code of conduct
We welcome everyone into the llmware
community. View our Code of Conduct in our GitHub repository.
llmware
and AI Bloks
llmware
is an open source project from AI Bloks - the company behind llmware
. The company offers a Software as a Service (SaaS) Retrieval Augmented Generation (RAG) service. AI Bloks was founded by Namee Oberst and Darren Oberst in October 2022.
License
llmware
is distributed by an Apache-2.0 license.