Skip to content

Commit 9ef7985

Browse files
authored
Merge pull request #30 from The-Standard-Organization/users/hassanhabib/documentation-update-code-sample
DOCUMENTATIONS: Update Code Sample
2 parents 6204b53 + 6cd07bb commit 9ef7985

1 file changed

Lines changed: 60 additions & 18 deletions

File tree

README.md

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,54 @@
1-
# [Standard.AI.PeerLLM]
1+
# Standard.AI.PeerLLM
22

33
[![Build](https://github.com/The-Standard-Organization/Standard.AI.PeerLLM/actions/workflows/build.yml/badge.svg)](https://github.com/The-Standard-Organization/Standard.AI.PeerLLM/actions/workflows/build.yml)
44
[![The Standard](https://img.shields.io/github/v/release/hassanhabib/The-Standard?filter=v2.10.2&style=default&label=Standard%20Version&color=2ea44f)](https://github.com/hassanhabib/The-Standard)
55
[![The Standard - COMPLIANT](https://img.shields.io/badge/The_Standard-COMPLIANT-2ea44f)](https://github.com/hassanhabib/The-Standard)
66
[![The Standard Community](https://img.shields.io/discord/934130100008538142?color=%237289da&label=The%20Standard%20Community&logo=Discord)](https://discord.gg/vdPZ7hS52X)
77

8-
## Introduction
8+
---
99

10-
Standard.AI.PeerLLM — A Standardized .NET library for PeerLLM, enabling developers to integrate AI-powered solutions into their .NET applications.
10+
## 🧠 Introduction
1111

12+
**Standard.AI.PeerLLM** — A standardized .NET library for [PeerLLM](https://www.peerllm.com), enabling developers to integrate AI-powered and decentralized intelligence into their .NET applications.
1213

13-
### Chats
14-
The following example demonstrate how you can write your first Completions program.
14+
This library follows **The Standard** design and architectural principles — ensuring ethical, maintainable, and testable AI-driven software systems that can be trusted, evolved, and reused across teams and organizations.
15+
16+
---
17+
18+
## 🌐 What is PeerLLM?
19+
20+
**PeerLLM** is a decentralized, community-powered AI network where compute, data, and models are contributed by individuals (“hosts”).
21+
Consumers of AI services — such as inference or fine-tuning — can access that distributed capacity securely and transparently.
22+
23+
Unlike traditional centralized AI providers, PeerLLM distributes ownership, computation, and benefit — allowing everyone to participate in the AI economy.
24+
25+
**Key Pillars:**
26+
- ⚖️ **Fairness & Transparency** — Governance and accounting built into the network.
27+
- 🧩 **Open Collaboration** — Compute, data, and models shared through standardized APIs.
28+
- 💡 **Democratized Access** — AI for everyone, not just a few centralized providers.
29+
30+
---
31+
32+
## 🚀 Why .NET Developers Should Build on PeerLLM
33+
34+
PeerLLM gives .NET developers the power to build AI-driven applications that are **private**, **distributed**, and **community-powered** — all without relying on a single centralized provider.
35+
36+
By integrating your .NET app with the PeerLLM network, you can:
37+
38+
- **🖥️ Run Anywhere** — Deploy on Windows, Linux, or macOS using familiar .NET tooling while connecting seamlessly to a global AI host network.
39+
- **🔒 Stay Private** — Keep user data and chat history client-side or within your own infrastructure, with no centralized data collection.
40+
- **⚡ Scale Efficiently** — Tap into distributed compute provided by community hosts instead of managing expensive cloud clusters.
41+
- **🤖 Extend with AI** — Call into local or remote models (like Mistral or LLaMA) through PeerLLM’s simple APIs for inference, fine-tuning, or orchestration.
42+
- **💰 Contribute and Earn** — Turn your .NET service or desktop app into a PeerLLM Host and earn tokens by serving AI workloads.
43+
44+
> 🧩 **Build smarter, faster, and more independently — with .NET on PeerLLM, your code becomes part of a decentralized AI ecosystem designed for fairness, transparency, and innovation.**
45+
46+
---
47+
48+
## 🧪 Quick Start — Your First PeerLLM Chat
49+
50+
Here’s how you can start your first chat completion program in .NET:
1551

16-
#### Program.cs
1752
```csharp
1853
using System;
1954
using System.Threading.Tasks;
@@ -26,25 +61,32 @@ namespace ExamplePeerLLMDotNet
2661
static async Task Main(string[] args)
2762
{
2863
var peerLLMConfiguration = new PeerLLMConfiguration();
29-
PeerLLMClient peerLLMClient = new PeerLLMClient(peerLLMConfiguration);
30-
31-
ChatSessionConfig chatSessionConfig = new ChatSessionConfig
64+
65+
var peerLLMClient =
66+
new PeerLLMClient(peerLLMConfiguration);
67+
68+
var chatSessionConfig = new ChatSessionConfig
3269
{
3370
ModelName = "mistral-7b-instruct-v0.1.Q8_0",
3471
};
35-
36-
Guid conversationId = await this.peerLLMClient.V1.Chats.StartChatAsync(chatSessionConfig);
72+
73+
Guid conversationId =
74+
await peerLLMClient.V1.Chats
75+
.StartChatAsync(chatSessionConfig);
76+
3777
List<string> tokens = new List<string>();
38-
39-
IAsyncEnumerable<string> responseStream = this.peerLLMClient.V1.Chats.StreamChatAsync(
40-
conversationId, text: "Hello, how are you?");
41-
78+
79+
IAsyncEnumerable<string> responseStream =
80+
peerLLMClient.V1.Chats.StreamChatAsync(
81+
conversationId,
82+
text: "Hello, how are you?");
83+
4284
await foreach (string token in responseStream)
4385
{
44-
tokens.Add(token);
86+
Console.Write(token);
4587
}
46-
47-
Console.WriteLine(string.Concat(tokens));
88+
89+
Console.WriteLine("Chat session ended.");
4890
}
4991
}
5092
}

0 commit comments

Comments
 (0)