ghrepo - ShinyChatGPT

A ChatGPT Clone Built with R and Shiny

By Tolga

ShinyChatGPT is a fully functional ChatGPT clone built entirely in R using the Shiny framework. It provides a clean, interactive web interface to OpenAI’s Chat Completions API, allowing you to chat with models like GPT-3.5-turbo, GPT-4, and GPT-4o directly from your browser.

Chat Screen (Dark Mode)

Chat Screen (Light Mode)

Chat Interface

Key Features:

  • Modern chat interface with styled message bubbles
  • Light/dark theme toggle (saved in browser)
  • Adjustable parameters: temperature, max tokens, and custom system prompt
  • Loading spinner during API responses
  • Download chat history as a file
  • Clear chat functionality
  • Fully responsive design

The app is lightweight, requires only a few R packages (shiny, shinyjs, httr, jsonlite), and can be run locally in seconds. Just set your OpenAI API key as an environment variable and launch it.It’s a great example of how to integrate powerful LLMs into R-based web applications without needing Python or JavaScript frameworks.Try the live demo or run it yourself!

View on GitHub View Repository on GitHub

  Try Live Demo on shinyapps.io Try the Live Demo on shinyapps.io

Share: X (Twitter) Facebook LinkedIn