- A large cheat sheet on Rust 1/2.
- A large cheat sheet on Rust 2/2.
- Try the RustGPT hosted demo example
- Read the useful blog article
- Some useful
- By example
rustc --explain E0277
Rust-AI is latest experiment in cloning the abilities of OpenAI's Chat-AI. In this repository, a Rust-based server leveraging the Axum framework combined with HTMX, providing a Rusty web development experience. From database operations to streaming responses, this project covers a broad spectrum of backend functionalities and real-time web interactions. So, for Rust enthusiasts and web developers alike, dive in to explore a world where web development is redefined with the power of Rust!
- Rust with Axum Framework: A fast and reliable server that's all about performance and simplicity.
- SQLite: A lightweight yet powerful database for all your data persistence needs.
- Server Sent Events (SSE): Real-time streaming made easy to bring life to the ChatGPT interactions.
- HTMX: No hefty JavaScript frameworks needed—HTMX keeps interactions snappy with simple HTML attributes.
sqlx
: Direct and type-safe SQL queries and migrations.tera
: A templating engine inspired by Jinja2, for rendering the HTML views.axum
: A web application framework that's easy to use and incredibly fast.
For those eyeing some client-side WASM magic, you might also want to check out Yew or Leptos for more complex applications.
- Clone the repository.
- Create a .env
MIGRATIONS_PATH=db/migrations
TEMPLATES_PATH=templates
DATABASE_URL=sqlite:db/db.db
DATABASE_PATH=db/db.db
OPENAI_API_KEY=<api-key> (only necessary for tests, users will add their own keys)
- Install TailwindCSS Standalone in this repository: 1.1 Brew
cargo install just
: install Justjust init
: install additional tools and migrate the dbjust dev
: concurrently run tailwind and cargo run in watch mode- Open your browser and enjoy chatting with your Rust-powered ChatGPT clone (port 3000 by default)
- execute
title:terminal
# Example for macOS arm64
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/tailwindcss-macos-x64
chmod +x tailwindcss-macos-x64
mv tailwindcss-macos-x64 tailwindcss
- rename executable to
tailwindcss
Contributions are what make the open-source community an incredible place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make RustGPT better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thank you again!
Hats off to the wonderful crates and libraries that made Rust_AI possible!