Play Rock-Paper-Scissors against a smart AI that learns your patterns!
This project uses Meta's LLaMA 3 model served locally through Ollama, wrapped in a clean and interactive Streamlit web app.
- Tracks your move history (rock/paper/scissors count).
- Sends a prompt to LLaMA 3 via Ollama to predict the best AI move.
- Decides a winner and updates the score dynamically.
- Runs entirely locally โ no cloud or API keys needed.
| Tech | Description |
|---|---|
| ๐ Python | Core game logic and integration |
| ๐ฆ Ollama | Local LLaMA 3 model server |
| ๐ง LLaMA 3 | Metaโs advanced language model |
| ๐ Streamlit | Web interface for easy interaction |
git clone https://github.com/your-username/rock-paper-scissors-ai-ollama.git cd rock-paper-scissors-ai-ollama
Install dependencies:
pip install -r requirements.txt
Install and run the model locally:
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3 ollama run llama3
Keep this terminal running while playing.
streamlit run rps_app.py
โโโ main.py # CLI version of the game
โโโ rps_app.py # Streamlit web app
โโโ game_logic.py # AI integration & logic
โโโ requirements.txt # Dependencies
โโโ .gitignore # Ignored files
โโโ LICENSE # MIT license
โโโ README.md # This file
- โ Fun and intelligent gameplay
- ๐ง Learns from your move history
- โก Fast and runs offline
- ๐ ๏ธ Easy to customize and extend
- ๐ No API keys, no external dependencies
โYou are playing rock-paper-scissors. The player has played 'rock' 3 times, 'paper' 1 time, and 'scissors' 6 times. Based on this, what move would you choose next to win?โ
This project is licensed under the MIT License. LLaMA 3 is provided and governed by Meta's licensing terms. Ollama usage is governed by Ollama's terms.
Sagnik Datta Built with โค๏ธ using AI tools. ๐ GitHub