How sagnikdatta2k6/rock-paper-scissors-ai-ollama works
Project type and purpose
• This is a local Python-based “full-stack” toy application (more precisely, a self-contained frontend + backend + AI service) that lets a user play Rock-Paper-Scissors against an adaptive AI.
• The frontend is a Streamlit web app (rps_app.py) with an optional CLI client (main.py). The backend logic lives in game_logic.py. AI predictions come from a locally-hosted LLaMA 3 model served via Ollama.
File structure
• Top-level files:
– rps_app.py → Streamlit UI
– main.py → Command-line UI
– game_logic.py → Core game logic & AI integration
– requirements.txt, .gitignore, LICENSE, README.md
• No separate “backend” folder: the Python process hosts both UI and logic.
• External dependency: the Ollama daemon running the LLaMA 3 model (not in repo, but critical).
README for additional insights
• Confirms a purely local deployment: Streamlit + Python + Ollama + LLaMA 3.
• Describes how game_logic.py:
• Tracks move history in memory
• Builds a text prompt (“player has played rock X times…”)
• Sends it to the LLaMA 3 server via Ollama CLI (or API)
• Receives the AI’s chosen move, decides winner, updates scores.