Local AI Assistant สำหรับ macOS - AI Assistant ที่ทำงานแบบ local ด้วย Ollama พร้อมฟีเจอร์ครบครัน
- 💬 Real-time Chat - สนทนากับ AI แบบ real-time
- 🎤 Voice Interaction - รับฟังและพูดตอบ (STT/TTS)
- 👁️ Vision Capabilities - วิเคราะห์ภาพผ่าน webcam
- 📚 RAG System - ค้นหาข้อมูลส่วนตัวด้วย Retrieval-Augmented Generation
- 🏠 Fully Local - ทำงานบนเครื่องของคุณ ไม่ต้องส่งข้อมูลไปไหน
- ⚡ Fast & Responsive - ใช้ Ollama สำหรับ inference แบบ local
- Python 3.8+ - ภาษาโปรแกรมหลัก
- FastAPI - Web framework สำหรับ API
- Ollama - Local LLM inference engine
- ChromaDB - Vector database สำหรับ RAG
- Uvicorn - ASGI server
- React 18 - UI framework
- Vite - Build tool
- TypeScript - Type safety
- Tailwind CSS - Styling
- Shadcn/ui - UI components
- Gemma3n:e4b - ภาษาไทยและภาษาอังกฤษ
- LLaVA - Vision capabilities
- Whisper - Speech-to-Text
- Coqui TTS - Text-to-Speech
- macOS (แนะนำ macOS 12+)
- Python 3.8+
- Node.js 18+
- Ollama (ต้องติดตั้งก่อน)
- RAM: อย่างน้อย 8GB (แนะนำ 16GB+)
- Storage: อย่างน้อย 10GB สำหรับ models
- GPU: ไม่จำเป็น แต่จะช่วยให้เร็วขึ้น
git clone https://github.com/Prach07/HOPE_JARVIS_MacOS.git
cd HOPE_JARVIS_MacOS# macOS
curl -fsSL https://ollama.ai/install.sh | sh
# Start Ollama service
ollama serve# Pull chat model
ollama pull gemma3n:e4b
# Pull vision model (optional)
ollama pull llava
# Pull other models as needed
ollama list# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
source venv/bin/activate # macOS/Linux
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Start backend server
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev-
เริ่มต้นระบบ:
# Terminal 1: Start Ollama ollama serve # Terminal 2: Start Backend cd backend && source venv/bin/activate python -m uvicorn main:app --reload --port 8000 # Terminal 3: Start Frontend cd frontend npm run dev
-
เปิดเว็บไซต์:
- ไปที่
http://localhost:5173 - เริ่มสนทนากับ AI ได้เลย!
- ไปที่
# Non-streaming chat
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "สวัสดีครับ", "stream": false}'
# Streaming chat
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "สวัสดีครับ", "stream": true}' \
--no-buffercurl http://localhost:8000/
# Response: {"status": "HOPEM4 Backend is running!"}HOPE_JARVIS_MacOS/
├── backend/ # FastAPI backend
│ ├── main.py # Main server application
│ ├── requirements.txt # Python dependencies
│ └── venv/ # Virtual environment
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ └── main.tsx # App entry point
│ ├── package.json # Node.js dependencies
│ └── vite.config.ts # Vite configuration
├── tests/ # Test files (future)
└── README.md # This file
สร้างไฟล์ .env ใน backend directory:
# Ollama Configuration
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=gemma3n:e4b
# Server Configuration
HOST=0.0.0.0
PORT=8000
# CORS Configuration
FRONTEND_URL=http://localhost:5173เปลี่ยน model ใน backend/main.py:
class ChatRequest(BaseModel):
message: str
model: str = "gemma3n:e4b" # เปลี่ยนเป็น model ที่ต้องการ
stream: bool = True# Test root endpoint
curl http://localhost:8000/
# Test chat endpoint
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "ทดสอบ", "stream": false}'- เปิด
http://localhost:5173 - ทดสอบการส่งข้อความ
- ตรวจสอบ streaming response
-
Ollama ไม่ทำงาน:
# ตรวจสอบ Ollama service ollama list # Restart Ollama pkill ollama ollama serve
-
Model ไม่พบ:
# ดู models ที่มี ollama list # Pull model ที่ต้องการ ollama pull gemma3n:e4b
-
Port ถูกใช้งาน:
# ตรวจสอบ port ที่ใช้งาน lsof -i :8000 lsof -i :5173 # Kill process ที่ใช้ port kill -9 <PID>
-
Memory ไม่พอ:
- ปิด applications อื่นๆ
- ลด model size
- เพิ่ม RAM
- Basic chat interface
- Ollama integration
- Streaming responses
- Thai language support
- Speech-to-Text (STT)
- Text-to-Speech (TTS)
- Webcam integration
- Image analysis
- Document ingestion
- Vector database setup
- Semantic search
- Context-aware responses
- Multi-modal conversations
- File upload support
- Conversation history
- Custom model fine-tuning
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'feat: add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Ollama - สำหรับ local LLM inference
- Google - สำหรับ Gemma models
- FastAPI - สำหรับ backend framework
- React - สำหรับ frontend framework
- Tailwind CSS - สำหรับ styling
หากมีปัญหาหรือคำถาม:
- สร้าง Issue ใน GitHub repository
- ตรวจสอบ Troubleshooting section
- อ่าน documentation ของแต่ละ component
Made with ❤️ for local AI enthusiasts