Skip to content

moony01/ai-poet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Poet

AI poetry generator — Streamlit web app that generates poems on demand using Langchain with OpenAI GPT or local LLama models.

Live License: MIT Python Langchain

🌐 Live Demo: https://ai-poet-moony.streamlit.app/


Overview

AI Poet is a Streamlit-based web app that generates original poems using Langchain. The app supports two LLM backends — OpenAI's GPT (via API) and Meta's LLama 2 (local inference) — and lets you switch between them seamlessly.

Key Features

  • ✍️ AI-Generated Poetry — Theme-driven poem generation
  • 🔄 Dual LLM Backend — Switch between OpenAI GPT (cloud) and LLama 2 (local)
  • 🔒 Local Inference Option — Run LLama 2 fully offline, no API key needed
  • Streaming Output — Real-time token streaming for live poem display
  • 🐍 Single-File App — Minimal Streamlit codebase, easy to fork

Tech Stack

Layer Technology
Web Framework Streamlit
LLM Orchestration Langchain
LLMs OpenAI GPT (cloud), Meta LLama 2 (local)
Language Python 3.9

Local Development

Prerequisites

Setup (OpenAI Mode)

git clone https://github.com/moony01/ai-poet.git
cd ai-poet

pip install -r requirements.txt

# Add your OpenAI API key to .env
echo "OPENAI_API_KEY=sk-..." > .env

streamlit run main.py

Open the URL printed in the terminal (usually http://localhost:8501).

Setup (Local LLama 2)

  1. Download a quantized LLama 2 GGML model (e.g. llama-2-7b-chat.ggmlv3.q2_K.bin)
  2. Place it in the project root
  3. Run:
    streamlit run llama.py

Project Structure

ai-poet/
├── main.py             # OpenAI-backed Streamlit app
├── llama.py            # Local LLama 2 Streamlit app
├── requirements.txt    # Python dependencies
└── .devcontainer/      # VSCode dev container config

License

MIT License © 2024–2026 moony01

You are free to use, modify, and distribute this code. Attribution appreciated.

Contact

About

AI Poetry Generator — Streamlit web app that generates poems on demand using Langchain with OpenAI GPT or local LLama models.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors

Languages