Skip to content

A Docker-based chat interface that communicates locally with an Ollama instance using React (Vite) and a FastAPI backend. Ideal for quick experiments with LLMs on your own computer.

Notifications You must be signed in to change notification settings

Oliverwebdev/ollama_interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EchoCore - KI Chat Interface

Dieses Projekt stellt eine moderne, interaktive Chat-Anwendung bereit, um über ein React-Frontend und ein Python/FastAPI-Backend mit einer lokalen Ollama-Instanz zu interagieren.
Es nutzt modernes Styling (OpenAI-Look), mobile Optimierung und erlaubt den Upload von Bildern, PDFs & Textdateien zur Analyse durch das KI-Modell.

📌 Inhaltsverzeichnis


🚀 Überblick

  • Frontend (React + Vite) → Moderner Chat mit OpenAI-Optik
  • Backend (FastAPI) → Sendet Anfragen an Ollama (lokale KI)
  • Ollama → Führt KI-Modelle aus (deepseek-r1:7b oder andere)
  • Docker & Docker Compose → Container-Management

🔗 Datenfluss

[Browser / Frontend] → [FastAPI-Backend in Docker] → [Ollama auf dem Host-System]

Technologie-Stack

  • React mit Vite (Frontend)
  • Python 3.10 mit FastAPI (Backend)
  • Docker & Docker Compose
  • Ollama (Lokaler Modellserver)

📂 Projektstruktur

echocore/
├── backend/
│   ├── Dockerfile           # Backend (Python) Container Setup
│   ├── requirements.txt     # Python-Abhängigkeiten
│   ├── main.py              # FastAPI-App (mit /ollama Endpoint)
├── frontend/
│   ├── Dockerfile           # Frontend (Node/Vite) Container Setup
│   ├── package.json         # NPM-Skripte & Dependencies
│   ├── src/
│   │   ├── App.jsx          # React-Hauptkomponente (Chat-UI)
│   │   ├── App.css          # Komplettes UI-Styling (Desktop + Mobile)
│   │   └── Spinner.jsx      # Lade-Animation
├── docker-compose.yml       # Orchestrierung für Frontend + Backend
├── README.md                # Dieses Dokument
└── .gitignore               # Verhindert unnötige Uploads

🛠 Voraussetzungen

  • Docker (empfohlen Version ≥ 20.10)
  • Docker Compose (≥ 1.29)
  • Ollama lokal installiert (≥ 0.4.5)
  • Python nur für lokale Backend-Starts notwendig

🚀 Installation & Start

1️⃣ Docker Compose starten

cd echocore
sudo docker compose up --build
  • Frontend läuft unter: http://localhost:5173
  • Backend API unter: http://localhost:8000/docs
  • Ollama KI läuft auf: http://localhost:11434

💬 Nutzung

📥 Eingabe

  • Der User gibt eine Nachricht ein.
  • Falls Anhänge (Bilder, PDFs, TXT) vorhanden sind, werden sie mitgesendet.

🔄 Verarbeitung

  • FastAPI empfängt die Anfrage
  • Falls eine Datei gesendet wurde:
    • TXT → Direkt in den Prompt eingefügt
    • PDF → Text extrahiert & angehängt
    • Bilder → OCR-Texterkennung mit Tesseract
    • Andere Formate → In Base64 gewandelt

📤 Antwort

  • Ollama verarbeitet die Eingabe & sendet das JSON zurück.
  • Frontend zeigt die Antwort mit OpenAI-Optik im Chat an.
  • Falls <think>-Tags erkannt werden, erscheinen diese als Denkblasen.

🌟 Features

🔹 Modernes Chat-Design (OpenAI-Stil)
📱 100% Responsive (Mobile & Desktop)
📂 Anhänge: PDFs, Bilder, Textdateien analysieren
🧠 <think>-Tags als Denkblasen anzeigen
🎨 Light & Dark Mode-Unterstützung (optional)
⚡ Schnelle Performance dank Vite & FastAPI


⚙️ Konfiguration

🔧 Frontend (App.jsx)

  • Chat-UI & Denkblasen-Logik
  • Request an http://localhost:8000/ollama
  • Styling in App.css für OpenAI-Optik

🔧 Backend (main.py)

  • Ollama URL: http://host.docker.internal:11434/api/generate
  • Modelleinstellungen: Standard "deepseek-r1:7b"
    → Kann für andere Modelle geändert werden.

🔧 Docker Compose

  • Definiert frontend & backend
  • extra_hosts: "host.docker.internal:host-gateway" für Netzwerkzugriff

🚀 Zukünftige Erweiterungen

Live-Streaming von Antworten (stream: true)
Weitere Datei-Formate wie MP3-Transkription
Offline-Modus für lokale Nutzung
Modell-Auswahl direkt im Chat


📜 Lizenz

Dieses Projekt ist Open Source. Nutze es, verbessere es & entwickle es weiter! 🚀



 OLLAMA_HOST=0.0.0.0 OLLAMA_PORT=11434 ollama serve

About

A Docker-based chat interface that communicates locally with an Ollama instance using React (Vite) and a FastAPI backend. Ideal for quick experiments with LLMs on your own computer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published