Overview • Features • Quickstart • Contributing
infinite-bookshelf.demo.jul31.1.mov
Imagine you want to learn about Natural Language Processing. You instantly get an 100 page book with chapters, content, and structure. What if you find the language too technical? You can change the prompt and the book – all 100 pages – adapts to your needs. What if you want to learn how to code the technology in python? You can ask for that too, and in seconds, every chapter has code examples alongside the instructional content. That’s the power of an Infinite Bookshelf.
Full demo of Infinite Bookshelf fast generation of book content
Infinite Bookshelf is a streamlit app that scaffolds the creation of books from a one-line prompt using Llama3 on Groq. It works well on nonfiction books and generates each chapter within seconds. The app mixes Llama3-8b and Llama3-70b, utilizing the larger model for generating the structure and the smaller of the two for creating the content. Currently, the model only uses the context of the section title to generate the chapter content. In the future, this will be expanded to the fuller context of the book to allow Infinite Bookshelf to generate quality fiction books as well.
- 📖 Scaffolded prompting that strategically switches between Llama3-70b and Llama3-8b to balance speed and quality
- 🖊️ Uses markdown styling to create an aesthetic book on the streamlit app that includes tables and code
- 📂 Allows user to download a text file with the entire book contents
Example | Prompt |
---|---|
LLM Basics | The Basics of Large Language Models |
Data Structures and Algorithms | Data Structures and Algorithms in Java |
Important
To use Infinite Bookshelf, you can use the hosted version at infinite.benjamin.sh Alternatively, you can run Infinite Bookshelf locally with streamlit using the quickstart instructions.
To use Infinite Bookshelf, you can use the hosted version at infinite.benjamin.sh
Alternative, you can run Infinite Bookshelf locally with streamlit.
First, you can set your Groq API key in the environment variables:
export GROQ_API_KEY="gsk_yA..."
This is an optional step that allows you to skip setting the Groq API key later in the streamlit app.
Next, you can set up a virtual environment and install the dependencies.
python3 -m venv venv
source venv/bin/activate # Bash
venv\Scripts\activate.bat # Windows
pip3 install -r requirements.txt
It may be required to install gtk3 for users on windows.
https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer?tab=readme-ov-file
Finally, you can run the streamlit app.
python3 -m streamlit run main.py
- Streamlit
- Llama3 on Groq Cloud
Infinite Bookshelf may generate inaccurate information or placeholder content. It should be used to generate books for entertainment purposes only.
Improvements through PRs are welcome!
May 29th, 2024:
Added new inference statistics
June 8th, 2024:
Download Books as Styled PDFs
- Ability to title books which shows on downloads
- Ability to save books to Google drive
- Optional seed content field to input existing notes