Skip to content

Commit 5708a47

Browse files
committed
enhancements
1 parent 9c983e3 commit 5708a47

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

core/http/elements/gallery.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,22 @@ func P2PNodeStats(nodes []p2p.NodeData) string {
102102
}
103103
}
104104

105+
class := "text-green-500"
106+
if online == 0 {
107+
class = "text-red-500"
108+
}
109+
/*
110+
<i class="fas fa-circle animate-pulse text-green-500 ml-2 mr-1"></i>
111+
*/
112+
circle := elem.I(attrs.Props{
113+
"class": "fas fa-circle animate-pulse " + class + " ml-2 mr-1",
114+
})
105115
nodesElements := []elem.Node{
106116
elem.Span(
107117
attrs.Props{
108-
"class": "text-green-500",
118+
"class": class,
109119
},
120+
circle,
110121
elem.Text(fmt.Sprintf("%d", online)),
111122
),
112123
elem.Span(

core/http/views/p2p.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
<div class="workers mt-12 text-center">
1212
<h2 class="text-3xl font-semibold text-gray-100 mb-8">
13-
<i class="fa-solid fa-network-wired"></i> P2P Network
13+
<i class="fa-solid fa-circle-nodes"></i> Distributed inference with P2P
1414
<a href="https://localai.io/features/distribute/" target="_blank">
1515
<i class="fas fa-circle-info pr-2"></i>
1616
</a>
1717
</h2>
18-
<p class="mb-4">LocalAI uses P2P technologies to enable distribution of work between peers. It is possible to share an instance with Federation and/or split the weights of a model across peers (only available with llama.cpp models).</p>
18+
<h5 class="mb-4 text-justify">LocalAI uses P2P technologies to enable distribution of work between peers. It is possible to share an instance with Federation and/or split the weights of a model across peers (only available with llama.cpp models). You can now share computational resources between your devices or your friends!</h5>
1919

2020
<!-- Tabs for Instructions -->
2121
<div class="bg-gray-800 p-6 rounded-lg shadow-lg mb-12 text-left">
22-
<h3 class="text-2xl font-semibold text-gray-100 mb-6">Start a new llama.cpp P2P worker</h3>
22+
<h3 class="text-2xl font-semibold text-gray-100 mb-6"><i class="fa-solid fa-book"></i> Start a new llama.cpp P2P worker</h3>
2323
<p class="mb-4">You can start llama.cpp workers to distribute weights between the workers and offload part of the computation. To start a new worker, you can use the CLI or Docker.</p>
2424

2525
<!-- Tabs navigation -->
@@ -54,15 +54,15 @@ <h3 class="text-2xl font-semibold text-gray-100 mb-6">Start a new llama.cpp P2P
5454
</div>
5555
</div>
5656

57-
<p class="text-xl font-semibold text-gray-200"> Nodes: <span hx-get="/p2p/ui/workers-stats" hx-trigger="every 1s"></span> </p>
57+
<p class="text-xl font-semibold text-gray-200"> <i class="text-gray-200 fa-solid fa-circle-nodes"></i> Workers (llama.cpp): <span hx-get="/p2p/ui/workers-stats" hx-trigger="every 1s"></span> </p>
5858
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mb-12">
5959
<div hx-get="/p2p/ui/workers" hx-trigger="every 1s"></div>
6060
</div>
6161

6262
<hr class="border-gray-700 mb-12">
6363

6464
<div class="bg-gray-800 p-6 rounded-lg shadow-lg mb-12 text-left">
65-
<h3 class="text-2xl font-semibold text-gray-100 mb-6">Start a federated instance</h3>
65+
<h3 class="text-2xl font-semibold text-gray-100 mb-6"><i class="fa-solid fa-book"></i> Start a federated instance</h3>
6666
<p class="mb-4">You can start LocalAI in federated mode to share your instance, or start the federated server to balance requests between nodes of the federation.</p>
6767

6868
<!-- Tabs navigation -->
@@ -112,7 +112,7 @@ <h3 class="text-2xl font-semibold text-gray-100 mb-6">Start a federated instance
112112
</div>
113113
</div>
114114

115-
<p class="text-xl font-semibold text-gray-200"> Nodes: <span hx-get="/p2p/ui/workers-federation-stats" hx-trigger="every 1s"></span> </p>
115+
<p class="text-xl font-semibold text-gray-200"> <i class="text-gray-200 fa-solid fa-circle-nodes"></i> Federated Nodes: <span hx-get="/p2p/ui/workers-federation-stats" hx-trigger="every 1s"></span> </p>
116116
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mb-12">
117117
<div hx-get="/p2p/ui/workers-federation" hx-trigger="every 1s"></div>
118118
</div>

core/http/views/partials/navbar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<a href="/tts/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-music pr-2"></i> TTS </a>
2323
<a href="/talk/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-phone pr-2"></i> Talk </a>
2424
{{ if .IsP2PEnabled }}
25-
<a href="/p2p/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-network-wired"></i> P2P </a>
25+
<a href="/p2p/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fa-solid fa-circle-nodes"></i> Swarm </a>
2626
{{ end }}
2727
<a href="/swagger/" class="text-gray-400 hover:text-white px-3 py-2 rounded"><i class="fas fa-code pr-2"></i> API</a>
2828
</div>
@@ -38,7 +38,7 @@
3838
<a href="/tts/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-music pr-2"></i> TTS </a>
3939
<a href="/talk/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-phone pr-2"></i> Talk </a>
4040
{{ if .IsP2PEnabled }}
41-
<a href="/p2p/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-network-wired"></i> P2P </a>
41+
<a href="/p2p/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fa-solid fa-circle-nodes"></i> Swarm </a>
4242
{{ end }}
4343
<a href="/swagger/" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1"><i class="fas fa-code pr-2"></i> API</a>
4444
</div>

0 commit comments

Comments
 (0)