Skip to content

Latest commit

 

History

History
44 lines (26 loc) · 1.21 KB

File metadata and controls

44 lines (26 loc) · 1.21 KB

Omama

Simple web UI using Axum and Tailwind to chat with a local Ollama.

The server changes markdown into HTML. The browser only sends and gets JSON. It shows the HTML it gets back.

How to Run

cargo run

Then go to: http://127.0.0.1:3000

API Endpoints

  • POST /api/chat Send: { "message": "...", "system_role": "optional", "model": "name:tag" } Get: { "response": "<html string>" }

  • GET /api/models – shows models that are ready.

  • GET /api/history – shows past messages for this session.

  • POST /api/clear – deletes chat history for this session.

It uses cookies to keep each session. Messages are stored in memory. Only recent messages are saved.

Frontend

  • Page is at src/web/index.html.
  • Uses Tailwind from a CDN.
  • JavaScript connects buttons and inputs to the API. It puts the returned HTML into chat bubbles.

Code Overview

  • src/bin/web.rs – the server, connects to Ollama, and turns markdown into HTML.
  • src/web/index.html – the page layout and simple JavaScript.

Extra Info

  • Made for learning: no login, no saving to disk, runs on your computer.
  • The server changes markdown into HTML. Be careful if used with others.