HTTP/1.1 200 OK
content-type: text/html
content-length: 4937
date: Thu, 06 Feb 2025 10:43:10 GMT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dashboard</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">GaiaNet node dashboard</h1>
<p class="lead text-muted">Manage your own GaiaNet node.</p>
<p>
<a href="chatbot-ui/index.html" class="btn btn-primary">Chat with this node</a>
<a href="https://www.gaianet.ai/" class="btn btn-info">Learn more about GaiaNet</a>
</p>
</div>
</section>
<hr>
<div id="api-sample" class="container">
<h4>Send an API request to the node</h4>
<p>The node supports the OpenAI JSON format. If you have an OpenAI-based agent or application, you simply need to replace the <code>api.openai.com</code> URL in your app with the node's public URL.</p>
<p>
<pre><code id="api-req">
curl -X POST <public_url>/v1/chat/completions \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"messages":[{"role":"system", "content": "You are a helpful assistant."}, {"role":"user", "content": "Where is Paris?"}]}'
</code></pre>
</p>
</div>
<div id="openaiInfo" class="container">
<p>Replace OpenAI configuration in your app with the following.</p>
<table id="openaiTable" class="table table-striped">
<thead>
<tr>
<th scope="col">Config option</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div id="nodeInfo" class="container">
<p>Node information</p>
<table id="nodeTable" class="table table-striped">
<thead>
<tr>
<th scope="col">Attribute</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<script>
function addToTable(k, v, table_id) {
const row = document.createElement('tr');
const keyCell = document.createElement('td');
const valueCell = document.createElement('td');
keyCell.textContent = k;
valueCell.textContent = v;
row.appendChild(keyCell);
row.appendChild(valueCell);
const tableBody = document.getElementById(table_id).querySelector('tbody');
tableBody.appendChild(row);
}
// Fetch the JSON file
fetch('config_pub.json')
.then(response => response.json())
.then(data => {
console.log(data)
var key = "Node ID or address";
var val = data["address"];
addToTable (key, val, 'nodeTable');
key = "GaiaNet domain";
val = data["domain"];
addToTable (key, val, 'nodeTable');
key = "Public URL";
val = "https://" + data["address"] + "." + data["domain"];
addToTable (key, val, 'nodeTable');
key = "API base URL";
val = "https://" + data["address"] + "." + data["domain"] + "/v1";
addToTable (key, val, 'openaiTable');
key = "Description";
val = data["description"];
addToTable (key, val, 'nodeTable');
key = "Finetuned LLM";
val = data["chat"].split('/').pop();
addToTable (key, val, 'nodeTable');
key = "Model name for chat";
// val = val.slice(0, -5);
val = data["chat_name"].split('/').pop();
addToTable (key, val, 'openaiTable');
key = "System prompt";
val = data["system_prompt"];
addToTable (key, val, 'nodeTable');
key = "Embedding model for knowledge vectors";
val = data["embedding"].split('/').pop();
addToTable (key, val, 'nodeTable');
key = "Model name for text embedding";
// val = val.slice(0, -5);
val = data["embedding_name"].split('/').pop();
addToTable (key, val, 'openaiTable');
key = "Knowledge base";
val = data["snapshot"].split('/').pop();
addToTable (key, val, 'nodeTable');
key = "RAG prompt";
val = data["rag_prompt"];
addToTable (key, val, 'nodeTable');