|
|
<!DOCTYPE html> |
|
|
<html lang="en"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>FlameGuardian - AI Integration Control</title> |
|
|
<script src="https://cdn.tailwindcss.com"></script> |
|
|
<script src="https://unpkg.com/feather-icons"></script> |
|
|
<style> |
|
|
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap'); |
|
|
body { |
|
|
font-family: 'Poppins', sans-serif; |
|
|
} |
|
|
.ai-output { |
|
|
aspect-ratio: 16/9; |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body class="bg-gray-50 min-h-screen"> |
|
|
<div class="container mx-auto px-4 py-8"> |
|
|
<div class="flex justify-between items-center mb-8"> |
|
|
<h1 class="text-2xl font-bold text-gray-800 flex items-center"> |
|
|
<i data-feather="brain" class="mr-2"></i> |
|
|
AI Integration Control |
|
|
</h1> |
|
|
<div class="flex space-x-4"> |
|
|
<a href="index.html" class="text-blue-600 hover:text-blue-800 flex items-center"> |
|
|
<i data-feather="arrow-left" class="mr-1"></i> Back to Dashboard |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8"> |
|
|
|
|
|
<div class="bg-white rounded-xl shadow-md p-6"> |
|
|
<h2 class="text-lg font-semibold mb-4 flex items-center"> |
|
|
<i data-feather="cpu" class="mr-2"></i> |
|
|
AI Model Control |
|
|
</h2> |
|
|
<div class="space-y-4"> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">AI Model Selection</label> |
|
|
<select class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"> |
|
|
<option>Qwen3-VL-235B-A22B-Thinking</option> |
|
|
<option>GPT-4 Vision</option> |
|
|
<option>Claude 3 Opus</option> |
|
|
<option>Gemini Pro Vision</option> |
|
|
</select> |
|
|
</div> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">HuggingFace API Key</label> |
|
|
<input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="hf_xxxxxxxxxxxxxxxx"> |
|
|
</div> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">OpenAI-Compatible Endpoint</label> |
|
|
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" value="https://router.huggingface.co/v1"> |
|
|
</div> |
|
|
<div class="flex items-center"> |
|
|
<input type="checkbox" id="enableAI" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked> |
|
|
<label for="enableAI" class="ml-2 block text-sm text-gray-700">Enable AI Processing</label> |
|
|
</div> |
|
|
<button class="w-full bg-green-600 text-white py-2 px-4 rounded-md hover:bg-green-700 transition flex items-center justify-center"> |
|
|
<i data-feather="refresh-cw" class="mr-2"></i> |
|
|
Initialize AI Connection |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="bg-white rounded-xl shadow-md p-6"> |
|
|
<h2 class="text-lg font-semibold mb-4 flex items-center"> |
|
|
<i data-feather="eye" class="mr-2"></i> |
|
|
AI Vision Output |
|
|
</h2> |
|
|
<div class="bg-gray-200 rounded-lg overflow-hidden ai-output"> |
|
|
<img src="http://static.photos/technology/640x360" alt="AI Vision Output" class="w-full h-full object-cover"> |
|
|
<div class="bg-black/50 text-white px-2 py-1 absolute bottom-2 left-2 rounded text-xs"> |
|
|
AI Analysis Output |
|
|
</div> |
|
|
</div> |
|
|
<div class="mt-4 p-4 bg-gray-100 rounded-lg"> |
|
|
<h3 class="font-medium text-gray-800 mb-2">AI Response:</h3> |
|
|
<p class="text-sm text-gray-600">The Statue of Liberty stands on Liberty Island in New York Harbor, a monumental sculpture gifted by France to the United States.</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="bg-white rounded-xl shadow-md p-6 mb-8"> |
|
|
<h2 class="text-lg font-semibold mb-4 flex items-center"> |
|
|
<i data-feather="settings" class="mr-2"></i> |
|
|
API Configuration |
|
|
</h2> |
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
|
|
<div> |
|
|
<h3 class="font-medium text-gray-800 mb-3">OpenAI-Compatible API</h3> |
|
|
<div class="space-y-4"> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Base URL</label> |
|
|
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" value="https://router.huggingface.co/v1"> |
|
|
</div> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Model Name</label> |
|
|
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" value="Qwen/Qwen3-VL-235B-A22B-Thinking"> |
|
|
</div> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">API Key</label> |
|
|
<input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="Enter your API key"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
<h3 class="font-medium text-gray-800 mb-3">Stream Settings</h3> |
|
|
<div class="space-y-4"> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Temperature</label> |
|
|
<input type="range" min="0" max="1" step="0.1" value="0.7" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"> |
|
|
<div class="text-right text-sm text-gray-600">0.7</div> |
|
|
</div> |
|
|
<div> |
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Max Tokens</label> |
|
|
<input type="number" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" value="1000"> |
|
|
</div> |
|
|
<div class="flex items-center"> |
|
|
<input type="checkbox" id="enableStream" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked> |
|
|
<label for="enableStream" class="ml-2 block text-sm text-gray-700">Enable Streaming</label> |
|
|
</div> |
|
|
<button class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 transition"> |
|
|
<i data-feather="play" class="inline mr-2"></i> |
|
|
Test Connection |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="bg-white rounded-xl shadow-md p-6"> |
|
|
<h2 class="text-lg font-semibold mb-4 flex items-center"> |
|
|
<i data-feather="code" class="mr-2"></i> |
|
|
Integration Code Example |
|
|
</h2> |
|
|
<div class="bg-gray-900 text-gray-100 p-4 rounded-lg font-mono text-sm overflow-x-auto"> |
|
|
<pre><code>import os |
|
|
from openai import OpenAI |
|
|
|
|
|
client = OpenAI( |
|
|
base_url="https://router.huggingface.co/v1", |
|
|
api_key=os.environ["HF_TOKEN"], |
|
|
) |
|
|
|
|
|
stream = client.chat.completions.create( |
|
|
model="Qwen/Qwen3-VL-235B-A22B-Thinking", |
|
|
messages=[ |
|
|
{ |
|
|
"role": "user", |
|
|
"content": [ |
|
|
{ |
|
|
"type": "text", |
|
|
"text": "Describe this image in one sentence." |
|
|
}, |
|
|
{ |
|
|
"type": "image_url", |
|
|
"image_url": { |
|
|
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" |
|
|
} |
|
|
} |
|
|
] |
|
|
} |
|
|
], |
|
|
stream=True, |
|
|
) |
|
|
|
|
|
for chunk in stream: |
|
|
print(chunk.choices[0].delta.content, end="")</code></pre> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<script> |
|
|
feather.replace(); |
|
|
</script> |
|
|
</body> |
|
|
</html> |