This repository has been archived on 2024-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
local-llm-server/templates/home.html

185 lines
6.1 KiB
HTML
Raw Normal View History

2023-08-23 23:11:12 -06:00
<!DOCTYPE html>
<html lang="en">
2023-08-23 23:11:12 -06:00
<head>
<title>{{ llm_middleware_name }}</title>
2023-08-23 23:11:12 -06:00
<meta content="width=device-width, initial-scale=1" name="viewport"/>
{{ analytics_tracking_code|safe }}
<!-- https://highlightjs.org/demo#lang=json -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
2023-08-23 23:11:12 -06:00
<style>
.container {
padding: 1em 3em;
}
#json {
background-color: rgb(229 231 235);
2023-08-23 23:11:12 -06:00
padding: 1em;
display: inline-block;
margin: auto;
max-width: 95%;
2023-08-23 23:11:12 -06:00
}
body {
2023-08-24 18:00:04 -06:00
background-color: #f3f4f6;
}
.info-box {
background-color: white;
padding: 1em;
margin: auto;
border-radius: 10px;
max-width: 95%;
}
2023-08-24 17:57:15 -06:00
pre code.hljs {
padding: 0 !important;
}
2023-08-23 23:48:46 -06:00
a, a:visited {
color: blue;
}
.footer {
font-size: 7pt;
text-align: center;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
text-align: justify;
}
2023-08-23 23:11:12 -06:00
@media only screen and (max-width: 600px) {
.container {
padding: 1em;
}
h1 {
font-size: 1.5em;
}
}
2023-09-11 20:47:19 -06:00
.hidden {
display: none;
}
2023-09-30 19:41:50 -06:00
.header-workers {
font-weight: normal;
2023-09-30 20:01:36 -06:00
font-size: 14pt;
2023-09-30 19:41:50 -06:00
}
2023-09-30 19:59:30 -06:00
h3 {
font-size: 16pt;
}
2023-09-30 20:11:14 -06:00
.no-marker {
list-style: none;
}
2023-08-23 23:11:12 -06:00
</style>
</head>
<body>
<script>
const backend_online = {% if current_model != 'offline' %}true{% else %}false{% endif %};
</script>
2023-08-23 23:11:12 -06:00
<div class="container">
<h1 style="text-align: center;margin-top: 0;">{{ llm_middleware_name }}</h1>
<div class="info-box">
2023-09-30 19:41:50 -06:00
<p><strong>Current Model:</strong> <span id="model">{{ default_model }}</span></p>
<p>
<strong>Estimated Wait Time:</strong> <span id="estimatedWait">{{ default_estimated_wait }}</span><br>
Processing: {{ default_active_gen_workers }}<br>
Queued: {{ default_proompters_in_queue }}
</p>
2023-09-12 16:43:15 -06:00
<br>
<p><strong>Client API URL:</strong> {{ client_api }}</p>
<p><strong>Streaming API URL:</strong> {{ ws_client_api if enable_streaming else 'Disabled' }}</p>
2023-09-12 16:40:09 -06:00
<p><strong>OpenAI-Compatible API URL:</strong> {{ openai_client_api }}</p>
2023-09-13 20:40:55 -06:00
{% if info_html|length > 1 %}
<br>
{{ info_html|safe }}
2023-09-13 20:40:55 -06:00
{% endif %}
</div>
2023-08-23 23:11:12 -06:00
<br>
<div class="info-box">
2023-09-30 19:59:30 -06:00
<h3>Instructions</h3>
<div id="instructions">
<ol>
2023-09-30 23:03:42 -06:00
<li>In Settings > Power User Options, enable <kbd>Relaxed API URLS</kbd>.</li>
<li>Set your API type to <kbd>{{ mode_name }}</kbd></li>
<li>Enter <kbd>{{ client_api }}</kbd> in the <kbd>{{ api_input_textbox }}</kbd> textbox.</li>
2023-09-30 20:11:14 -06:00
{% if enable_streaming %}
<li>Enter <kbd>{{ ws_client_api }}</kbd> in the <kbd>{{ streaming_input_textbox }}</kbd> textbox.</li>
{% endif %}
2023-09-12 01:10:58 -06:00
<li>If you have a token, check the <kbd>Mancer AI</kbd> checkbox and enter your token in the <kbd>Mancer
2023-08-29 17:56:12 -06:00
API key</kbd> textbox.
</li>
<li>Click <kbd>Connect</kbd> to test the connection.</li>
2023-09-30 19:41:50 -06:00
<li>Open your preset config and set <kbd>Context Size</kbd> to {{ default_context_size }}.</li>
2023-08-29 14:00:35 -06:00
<li>Follow this guide to get set up: <a href="https://rentry.org/freellamas" target="_blank">rentry.org/freellamas</a>
</li>
</ol>
</div>
2023-09-13 20:25:56 -06:00
{% if openai_client_api != 'disabled' and expose_openai_system_prompt %}
<br>
<div id="openai">
<strong>OpenAI-Compatible API</strong>
2023-09-13 20:27:20 -06:00
<p>The OpenAI-compatible API adds a system prompt to set the AI's behavior to a "helpful assistant". You can view this prompt <a href="/api/openai/v1/prompt">here</a>.</p>
2023-09-13 20:25:56 -06:00
</div>
{% endif %}
<br>
2023-08-29 14:00:35 -06:00
<div id="extra-info">{{ extra_info|safe }}</div>
2023-08-23 23:11:12 -06:00
</div>
<br>
2023-08-23 23:11:12 -06:00
2023-09-30 20:11:14 -06:00
<div class="info-box">
<h3>Statistics</h3>
Proompters:
<ul style="margin-top: 5px;">
<li class="no-marker">5 minutes: {{ proompters_5_min }}</li>
<li class="no-marker">24 hours: {{ proompters_24_hrs }}</li>
</ul>
</div>
<br>
2023-09-30 19:41:50 -06:00
{% for key, value in model_choices.items() %}
<div class="info-box">
2023-09-30 22:14:50 -06:00
<h3>{{ key }} <span class="header-workers">- {{ value.backend_count }} {% if value.backend_count == 1 %}worker{% else %}workers{% endif %}</span></h3>
{% if value.estimated_wait == 0 and value.estimated_wait >= value.concurrent_gens %}
{# There will be a wait if the queue is empty but prompts are processing, but we don't know how long. #}
{% set estimated_wait_sec = "less than " + value.estimated_wait|int|string + " seconds" %}
{% else %}
{% set estimated_wait_sec = value.estimated_wait|int|string + " seconds" %}
{% endif %}
2023-09-30 19:41:50 -06:00
<p>
<strong>Estimated Wait Time:</strong> {{ estimated_wait_sec }}<br>
2023-09-30 19:41:50 -06:00
Processing: {{ value.processing }}<br>
Queued: {{ value.queued }}<br>
</p>
<p>
<strong>Client API URL:</strong> {{ value.client_api }}<br>
<strong>Streaming API URL:</strong> {{ value.ws_client_api }}<br>
<strong>OpenAI-Compatible API URL:</strong> {{ value.openai_client_api }}
</p>
<p><strong>Context Size:</strong> {{ value.context_size }}</p>
2023-09-30 22:11:51 -06:00
<p><strong>Average Generation Time:</strong> {{ value.avg_generation_time | int }} seconds</p>
2023-09-30 19:41:50 -06:00
</div>
<br>
{% endfor %}
2023-08-23 23:11:12 -06:00
</div>
2023-08-23 23:48:46 -06:00
<div class="footer">
<a href="https://git.evulid.cc/cyberes/local-llm-server" target="_blank">git.evulid.cc/cyberes/local-llm-server</a>
</div>
2023-08-23 23:11:12 -06:00
</body>
</html>