TD-LLM-DND is a Streamlit-based web application that creates a Dungeons & Dragons style adventure using locally hosted llm from ollama.
Players can generate characters, start new adventures, and progress through turns with an automated Dungeon Master, AI powered party members and player interactions (TO:DO).
- Generate D&D Characters: Create unique characters with name, race, class, backstory, and items
- Start New Adventure: Begin a new adventure with the generated characters
- Turn-Based Gameplay: Progress through the adventure with player and Dungeon Master turns (TO:DO - add player input)
- Manage Models: Select/download and manage language models for the Dungeon Master and AI players
- Python 3.8+
- Streamlit
- Requests
- LangChain
- HuggingFace Transformers
- dotenv
-
Clone the repository:
git clone https://github.com/tegridydev/dnd-llm-game.git cd td-llm-dnd
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the root directory with the following content:OLLAMA_API_ENDPOINT=http://localhost:11434/api/generate PDF_FOLDER=pdf CHROMA_DB_DIR=./chroma_db TURN_LIMIT=10
-
Start Ollama:
ollama serve
-
Run the Streamlit app:
streamlit run app.py
-
Access the app: Open your browser and go to
http://localhost:8501
.
- Generate a new party.
- Start a new adventure.
- Play the next turn.
May your dice roll high!
Contributions are welcome! Please fork the repository and submit a pull request!