Skip to content

Instantly share code, notes, and snippets.

View KaushikShresth07's full-sized avatar

Kaushik Shresth KaushikShresth07

View GitHub Profile
VISION_SYSTEM_PROMPT = """You are analyzing a live camera image from the user. Your job is to describe what you see clearly and specifically.
RULES:
- Always describe the image in detail. Identify objects, text, people, actions, colors, positions, and any visible context.
- Answer the user's specific question directly (e.g. "what am I holding") with concrete, specific answers. Lead with the answer, then add brief detail.
- Never say you cannot see, are unable to tell, or don't have access to the image unless the image is truly blank, corrupted, or unreadable.
- Be confident and specific. If you see a phone, say "a phone" and what kind if visible. If you see text, read it out. If you see a person, describe what they're doing.
- Keep replies brief and natural (1-3 sentences) unless the user asks for more detail.
- When asked about text in the image: read it clearly and completely (OCR-style). Include all visible text.
- When asked about counting: count objects carefully and give the exact number.
import logging
import re
import time
from typing import List, Optional, Tuple, Literal
from config import GROQ_API_KEYS, INTENT_CLASSIFY_MODEL
logger = logging.getLogger("J.A.R.V.I.S")
CategoryType = Literal["general", "realtime", "camera", "task"]
ALL_CATEGORIES: List[str] = ["general", "realtime", "camera", "task", "mixed"]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>J.A.R.V.I.S — Viewer</title>
<style>
:root {
--bg: #0a0a1a;
--surface: #12122a;
:root {
--bg: #050510;
--glass-bg: rgba(10, 10, 28, 0.72);
--glass-border: rgba(255, 255, 255, 0.06);
--glass-hover: rgba(255, 255, 255, 0.10);
--accent: #7c6aef;
--accent-glow: rgba(124, 106, 239, 0.35);
--accent-secondary: #4ecdc4;
--text: rgba(255, 255, 255, 0.93);
--text-dim: rgba(255, 255, 255, 0.50);
const API = (typeof window !== 'undefined' && window.location.origin)
? window.location.origin
: 'http://localhost:8000';
let sessionId = null;
let currentMode = 'jarvis';
let isStreaming = false;
let isListening = false;
let camStream = null;
class OrbRenderer {
constructor(container, opts = {}) {
this.container = container;
this.hue = opts.hue ?? 0;
this.hoverIntensity = opts.hoverIntensity ?? 0.2;
this.bgColor = opts.backgroundColor ?? [0.02, 0.02, 0.06];
this.targetHover = 0;
this.currentHover = 0;
this.currentRot = 0;
this.lastTs = 0;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#050510">
<title>J.A.R.V.I.S</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
# J.A.R.V.I.S — Just A Rather Very Intelligent System
A personal AI assistant with a beautiful web UI. Talk to it, ask questions, search the web, generate images, analyze camera photos, and more. Runs completely on your own machine with one command.
**Quick start:** `pip install -r requirements.txt` → add your `GROQ_API_KEY` to `.env` → `python run.py` → open http://localhost:8000
## Features
### Three Chat Modes
fastapi>=0.100.0,<1.0
uvicorn[standard]>=0.22.0
langchain>=0.3.0
langchain-groq>=0.2.0
langchain-community>=0.3.0
langchain-core>=0.3.0
langchain-huggingface>=0.1.0
langchain-text-splitters>=0.2.0
sentence-transformers>=2.2.0
faiss-cpu>=1.7.0
import subprocess
import sys
from pathlib import Path
import uvicorn
def _ensure_thinking_audio():
try:
result = subprocess.run(
[sys.executable, "-m", "app.generate_thinking_audio"],