CoolFace
Apppublic

joyalshaju/nemotron-chat

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
App README

Nemotron Chat

A ChatGPT-style web app powered by NVIDIA Nemotron 3 (Super 120B / Ultra 550B) via the NIM API. FastAPI serves both the streaming API and the built React frontend from a single container.

Features

  • —Switch between Nemotron 3 Super (120B) and Ultra (550B) per chat
  • —Multiple chat sessions with sidebar
  • —Real-time streaming responses (SSE)
  • —Reasoning / thinking trace (collapsible), with an on/off toggle
  • —Code syntax highlighting with copy button
  • —Markdown rendering (tables, lists, bold, etc.)
  • —Glassmorphism dark UI

Deploying (Hugging Face Spaces)

This repo is a Docker Space. After pushing, set these as Space secrets (Settings → Variables and secrets):

  • —NVIDIA_API_KEY — your first NVIDIA NIM key
  • —NVIDIA_API_KEY_ULTRA — your second key (for the Ultra model)

The container builds the frontend and serves everything on port 7860.


Local development

Backend (FastAPI)

bash
cd backend
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env       # then add your NVIDIA keys
uvicorn main:app --reload --reload-include .env --port 8000
Get your NVIDIA NIM API keys at: https://build.nvidia.com

Frontend (React + Vite)

bash
cd frontend
npm install
npm run dev

Open http://localhost:5173. The Vite dev server proxies /chat and /health to the backend.


Running the full container locally

bash
docker build -t nemotron-chat .
docker run -p 7860:7860 --env-file backend/.env nemotron-chat
# open http://localhost:7860

API

GET /models — list selectable models.

POST /chat/stream

json
{
  "messages": [{"role": "user", "content": "Hello"}],
  "session_id": "uuid",
  "model": "super",
  "max_tokens": 4096,
  "enable_thinking": true,
  "reasoning_budget": 4096
}

Returns a Server-Sent Events stream with type: reasoning | content | usage | done | error.