Skip to content

Latest commit

ย 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Rock-Paper-Scissors AI (with LLaMA 3 + Ollama)

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.


๐Ÿง  How It Works

  • 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.

๐Ÿ› ๏ธ Technologies Used

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

๐Ÿš€ Getting Started

1. Clone the Repo

git clone https://github.com/your-username/rock-paper-scissors-ai-ollama.git cd rock-paper-scissors-ai-ollama

2. Set Up Environment

Install dependencies:

pip install -r requirements.txt

3. Set Up Ollama

Install and run the model locally:


Install Ollama

curl -fsSL https://ollama.com/install.sh | sh


Pull and run the LLaMA 3 model

ollama pull llama3 ollama run llama3

Keep this terminal running while playing.


4. Run the App

streamlit run rps_app.py


๐Ÿ—ƒ๏ธ Project Structure

โ”œโ”€โ”€ 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


๐Ÿ“ˆ Features

  • โœ… Fun and intelligent gameplay
  • ๐Ÿง  Learns from your move history
  • โšก Fast and runs offline
  • ๐Ÿ› ๏ธ Easy to customize and extend
  • ๐ŸŒ No API keys, no external dependencies

๐Ÿงช Sample AI Prompt

โ€œ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?โ€


๐Ÿ“„ License

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.


๐Ÿ™Œ Acknowledgements


โœจ Author

Sagnik Datta Built with โค๏ธ using AI tools. ๐Ÿ”— GitHub

About

๐ŸŽฎ Play Rock-Paper-Scissors against a smart AI using LLaMA 3 via Ollama. The AI analyzes your past moves to respond intelligently. Built with Python and Streamlit, this project showcases local LLMs in a fun, interactive way!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages