feat: initial IQAI multi-model AI dashboard
- Express backend with Replicate API proxy (chat, models, account, search) - React + Vite + Tailwind frontend with custom Midnight Violet color scheme - @mention autocomplete to route messages to specific models - Parallel multi-model queries with model selection in sidebar - DuckDuckGo web search context injection - Model manager UI (add/edit/remove Replicate models) - Per-model system instructions per conversation - Replicate account info display in sidebar - Conversation history with local persistence (Zustand) - Full Docker deployment (backend + nginx-served frontend) - Montserrat + Poppins fonts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
35
backend/routes/account.js
Normal file
35
backend/routes/account.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import express from 'express';
|
||||
|
||||
const router = express.Router();
|
||||
const REPLICATE_BASE = 'https://api.replicate.com/v1';
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
const token = process.env.REPLICATE_API_TOKEN;
|
||||
if (!token) return res.status(400).json({ error: 'REPLICATE_API_TOKEN not configured' });
|
||||
|
||||
try {
|
||||
const response = await fetch(`${REPLICATE_BASE}/account`, {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
});
|
||||
if (!response.ok) {
|
||||
const err = await response.json().catch(() => ({}));
|
||||
return res.status(response.status).json({ error: err.detail || 'Failed to fetch account' });
|
||||
}
|
||||
const account = await response.json();
|
||||
|
||||
// Try to get hardware/usage info
|
||||
let hardware = null;
|
||||
try {
|
||||
const hwRes = await fetch(`${REPLICATE_BASE}/hardware`, {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
});
|
||||
if (hwRes.ok) hardware = await hwRes.json();
|
||||
} catch (_) {}
|
||||
|
||||
res.json({ account, hardware });
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
export { router as accountRouter };
|
||||
Reference in New Issue
Block a user