https://github.com/twinnydotdev/symmetry-cli
The client for the Symmetry peer-to-peer inference network. Enabling users to connect with each other, share computational resources, and collect valuable machine learning data.
https://github.com/twinnydotdev/symmetry-cli
ai artificial-intelligence encryption holepunching hyperswarm inference llms localllm network p2p vscode-extension
Last synced: 3 months ago
JSON representation
The client for the Symmetry peer-to-peer inference network. Enabling users to connect with each other, share computational resources, and collect valuable machine learning data.
- Host: GitHub
- URL: https://github.com/twinnydotdev/symmetry-cli
- Owner: twinnydotdev
- License: apache-2.0
- Created: 2024-07-10T22:37:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-17T09:35:43.000Z (7 months ago)
- Last Synced: 2025-06-12T00:09:42.809Z (4 months ago)
- Topics: ai, artificial-intelligence, encryption, holepunching, hyperswarm, inference, llms, localllm, network, p2p, vscode-extension
- Language: JavaScript
- Homepage: https://docs.twinny.dev/general/symmetry/
- Size: 1.17 MB
- Stars: 26
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Citation: CITATION
Awesome Lists containing this project
README
# Symmetry
Use this repository to become an inference provider on the Symmetry network.
Symmetry is a distributed peer-to-peer network tool that allows users to share computational resources for AI inference. It enables users to connect directly and securely with each other, offering or seeking computational power for various AI tasks.
## Features
- Decentralized peer-to-peer network
- YAML-based configuration
- Privacy options
- Optional data collection for providers
- Compatible with various AI inference providers## Installation
To install Symmetry, use the following commands:
For Linux and macOS:
```bash
curl -fsSL https://www.twinny.dev/symmetry-unix.sh | sh
```For Windows:
```powershell
iwr -useb https://www.twinny.dev/symmetry-windows.ps1 | iex
```## Usage
To start Symmetry, run which will create a config file and detect your provider.
```bash
symmetry-cli start
```You will then be joined with the symmetry server and ready for connections!
```bash
âšī¸ INFO: đ Initializing client using config file: /home/twinnydotdev/.config/symmetry/provider.yaml
âšī¸ INFO: đ Symmetry client initialized.
âšī¸ INFO: đ Discovery key: xxx
âšī¸ INFO: đ Server key: 4b4a9cc325d134dee6679e9407420023531fd7e96c563f6c5d00fd5549b77435
âšī¸ INFO: đ Joining server, please wait.
âšī¸ INFO: đ Connected to server.
âšī¸ INFO: đ Saying hello to your provider...
âšī¸ INFO: đ Sending test request to http://localhost:11434/v1/chat/completions
âšī¸ INFO: đĄ Got response, checking stream...
âšī¸ INFO: â Test inference call successful!
```By default, Symmetry looks for its configuration file at `~/.config/symmetry/provider.yaml`. To use a different configuration file, use:
```bash
symmetry-cli start -c /path/to/your/provider.yaml
```## Configuration
Here's an example `provider.yaml` configuration:
```yaml
apiHostname: localhost # The hostname of the API server.
apiKey: # The API key for authentication.
apiBasePath: /v1 # The endpoint path for the api.
apiPort: 11434 # The port number on which the API server is listening.
apiProtocol: http # The protocol used to communicate with the API server.
modelName: llama3.1:latest # The name and version of the AI model to use.
name: twinnydotdev # Your chosen name as a provider on the Symmetry network.
serverKey: 4b4a9cc325d134dee6679e9407420023531fd7e96c563f6c5d00fd5549b77435 # The unique key for connecting to the Symmetry server.
systemMessage: "I'm a system message" # An optional system message for each conversation.
userSecret: # The secret key for user authentication and points tracking.
```Adjust these settings according to your preferences and setup.
## Architecture
```mermaid
graph TB
S[Symmetry Server]
subgraph "Inference Providers"
P1[Provider 1]
P2[Provider 2]
P3[Provider 3]
end
subgraph "Clients"
C1[Client 1 Requests Model B]
C2[Client 2 Requests Model C]
end
P1 <--> |"1. Connect & Auth & Register Model"| S
P2 <--> |"1. Connect & Auth & Register Model"| S
P3 <--> |"1. Connect & Auth & Register Model"| S
C1 -- "2. Connect" --> S
C2 -- "2. Connect" --> S
S -- "3. Assign Provider based on Model" --> C1
S -- "3. Assign Provider based on Model" --> C2
C1 <--> |"4. Inference Request/Response"| P2
C2 <--> |"4. Inference Request/Response"| P3
```## Development
To set up Symmetry for development:
1. Clone the repository:
```bash
git clone https://github.com/twinnydotdev/symmetry.git
cd symmetry
```2. Install dependencies:
```bash
npm install
```3. Build the project:
```bash
npm run build
```4. Start the development server:
```bash
npm run dev
```## Contributing
Contributions are welcome! Please submit your pull requests to the [GitHub repository](https://github.com/twinnydotdev/symmetry/pulls).
## License
This project is licensed under the [Apache 2.0 Licence](https://github.com/twinnydotdev/symmetry/blob/master/LICENCE).
## Support
If you encounter any issues or have questions, please [open an issue](https://github.com/twinnydotdev/symmetry/issues) on GitHub.
## Acknowledgments
We thank [Hyperswarm](https://github.com/holepunchto/hyperswarm) for providing the underlying peer-to-peer networking capabilities.