An open API service indexing awesome lists of open source software.

https://github.com/firstbatchxyz/dkn-compute-launcher

Cross-platform launcher for Dria Compute Node.
https://github.com/firstbatchxyz/dkn-compute-launcher

dria go launcher

Last synced: about 1 year ago
JSON representation

Cross-platform launcher for Dria Compute Node.

Awesome Lists containing this project

README

          


dria-logo



Dria Compute Launcher



A launcher, editor, and version manager for Dria Compute Node.



License: Apache-2.0


Workflow: Tests


Downloads


MSRV


Discord

The **Dria Compute Launcher** is a simple and efficient way to set up and run the [Dria Compute Node](https://github.com/firstbatchxyz/dkn-compute-node). The launcher automatically handles environment setup, model selection, and binary management, making it easy to start the node with minimal configuration.

It is packed with many features:

- [x] **Settings Menu**: You can change various settings such as your wallet, ports and API keys, all without leaving the launcher. You can also open a raw text-editor in terminal.
- [x] **Model Selection**: You can choose your models with a nice menu.
- [x] **Model Benchmarking**: You can measure TPS for Ollama models to see if your machine can handle them.
- [x] **Automatic Updates**: Launcher will automatically update a running compute node when there is an update & restart it; furthermore, it will update itself when there is a new launcher as well!
- [x] **Version Control**: You can select & run a specific compute node release.
- [x] **Auto-detect Ollama**: Launcher will check Ollama if you are using it's model, and start its server if required.

## Installation

**Linux / MacOS**

Open a terminal and run the following command:

```sh
curl -fsSL https://dria.co/launcher | bash
```

**Windows**

Open the Windows terminal [cmd.exe](https://en.wikipedia.org/wiki/Cmd.exe) in Administrator mode, and run the following command:

```sh
powershell -c "irm https://dria.co/launcher.ps1 | iex"
```

You may need to allow network access to the launcher if Windows prompts you to do so.

### Build from Source

You can build from source using [Rust](https://www.rust-lang.org/) & install the launcher globally using the command below:

```sh
cargo install --git https://github.com/firstbatchxyz/dkn-compute-launcher --locked
```

The [minimum supported rust version](https://github.com/foresterre/cargo-msrv) (MSRV) for the launcher is `1.81.0`. We use the `--locked` option to ensure you use the existing lockfile that is guaranteed to build.

## Usage

Double-click the executable or run it via the command line. The `help` to see available options:

```sh
# as a Unix executable
dkn-compute-launcher help

# as a Windows executable
dkn-compute-launcher.exe help
```

> [!CAUTION]
>
> Some Apple devices need you to bypass macOS's security warning. If you see "macOS cannot verify that this app is free from malware" when using the launcher use the following command:
>
> ```sh
> xattr -d com.apple.quarantine dkn-compute-launcher
> ```

All commands that you see with `help` have their own help messages within as well, you can view it with:

```sh
dkn-compute-launcher --help
```

### Model Providers

The purpose of running a Dria Compute Node is to serve LLMs to the network. These models can either be locally-hosted models via Ollama, or API-based models such as Gemini and OpenAI.

- To serve API-based models ([OpenAI](https://openai.com/), [Gemini](https://gemini.google.com/app), [OpenRouter](https://openrouter.ai/)), you will need to get their API keys.

- To serve a locally-hosted model with [Ollama](https://ollama.com/), you of course need Ollama installed, and you must make sure that your machine can handle your chosen models. See ["Measuring Local Models"](#measuring-local-models) chapter below to see the command-line tools that help you measure TPS.

### Starting a Node

Start your node with `start` command:

```sh
dkn-compute-launcher start
```

> [!NOTE]
>
> When you are running for the first time, the launcher will prompt you to fill in
> node information, such as your private key, chosen models and their respective provider information.

You can stop the node with CTRL+C (on Linux / Windows) or CMD+C (on macOS)

### Referrals Program

You can earn $DRIA points if you refer other users! When you refer a user, for each point they earn you earn a portion of those points as well.
To get a referral code, enter someone's referral code and such, use the following command:

```sh
dkn-compute-launcher referrals
```

> [!CAUTION]
>
> Each referral code only has 5 uses! Once you have referred 5 users, your code will no longer work.

### Changing Settings

You can use the `settings` command to change anything about your node:

```sh
dkn-compute-launcher settings
```

You will be greeted with a menu, where you can navigate with arrow keys and select an option with enter ENTER :

```yaml
? Choose settings (for .env)
> Wallet
Port
Models
Ollama
API Keys
Log Levels
✓ Save & Exit
✗ Abort Changes
```

Using this menu, you are able to change the following settings:

- **Wallet**: change your secret key
- **Port**: edit your listen address port, defaults to `4001`
- **Models**: view all models & edit the models that you want to serve
- **Ollama**: edit host & port of the Ollama server
- **API Keys**: change API keys for providers
- **Log Levels**: change log-levels for modules within compute node & launcher

Within a menu, you can go back by selecting ← Go Back. Within the main menu, you can select ✓ Save & Exit to save your changes & write them to the environment file, or you can choose ✗ Abort Changes to abort all changes.

> [!TIP]
>
> You can always exit the process (ungracefully) with CTRL+C (on Linux / Windows) or CMD+C (on macOS), or ESC on both systems.

### Models Menu

When you select Model option in the Settings menu, you will be greeted with another menu:

```py
? Choose model settings:
> Edit model selection
List chosen models
Remove local models
Measure local models
```

#### Selecting Models

Click on `Edit model selection` to select models for your node.

```sh
? Select a model provider:
> ollama
openai
gemini
openrouter
VLLM
← Go Back
```

Here, you can select a provider to choose models served by them, where you will be greeted with the following menu:

```sh
> Select a model provider: openai
? Choose your models with SPACE, then press ENTER:
[ ] gpt-4-turbo
[x] gpt-4o
> [ ] gpt-4o-mini
[ ] o1-mini
[ ] o1-preview
[ ] o1
[ ] o3-mini
# ...
```

Within this menu you can navigate by using the arrow keys and press SPACE to select a model. You can select all models using , or de-select everything with . To finish selecting models, press ENTER.

When you are done selecting models for all providers, you can go back to the main menu by selecting ← Go Back.

> [!TIP]
>
> You can pick `List chosen models` to show the list of models that you have picked for all providers.

#### Removing Local Models

When you run a node with local models, they are pulled to your machine and are stored within Ollama's files. You can remove them using Ollama commands, like:

```sh
# show downloaded models
ollama ls

# remove a model
ollama rm "model-name-here"
```

However, our launcher also provides a shortcut for that, you can pick the `Remove local models` option to choose models and remove them from your machine.

#### Measuring Local Models

You can test your machine's performance on locally served Ollama models by picking the `Measure local models` option.

Within Dria Knowledge Network, local models require you to reach a certain level of TPS. This command will measure your selected models, and then print a table of the results. We are particularly interested in **Eval TPS** and **Total (ms)** for our model performance.

```sh
Model Prompt TPS Time (ms) Eval TPS Time (ms) Total (ms)
qwen2.5-coder:1.5b 40.7747 981 67.9260 2488 3496
deepseek-r1:1.5b 21.4724 652 63.3591 16588 17255
driaforall/tiny-agent-a:1.5b 22.5653 842 47.1771 2586 3443
```

Measurements the fail to meet the Compute Node requirements will be colored in red.

### Displaying $DRIA Points

Use the `points` command to display how much you have earned!

```sh
dkn-compute-launcher points
```

### Updating Manually

Using the `update` command you can check for updates & automatically update your compute node and launcher.

```sh
dkn-compute-launcher update
```

You don't need to do this usually, as the launcher will always check for updates when you run the `start` command.

### Editing Environment File

For more advanced users that would like to view the environment file in more detail & plain-text, we provide the `env-editor` command:

```sh
dkn-compute-launcher env-editor
```

This command will open the selected environment file using a terminal-native text editor, allowing you to edit everything in it. If there happens to be multiple keys for a single value in the environment, the `settings` command will edit the _last uncommented key_ on **Save**.

### Running a Specific Release

Using the `specific` command you can choose to run a specific release:

```sh
# select & download
dkn-compute-launcher specific

# run after downloading
dkn-compute-launcher specific --run

# specify tag, skipping the selection menu
dkn-compute-launcher specific --run --tag 0.3.4
```

This is completely optional, and should mostly be used for debugging and testing on the live network.
When you run a specific release your node & launcher will **not** be automatically updated!

> [!CAUTION]
>
> The Dria Knowledge Network always considers the latest `minor` version as the active version; therefore,
> if the latest is `0.3.x` and you decide to run a smaller version like `0.2.x` you will most likely kept out of network due to protocol mismatch.

## Contributions

Contributions are welcome! You can start by cloning the repo:

```sh
git clone https://github.com/firstbatchxyz/dkn-compute-launcher
```

### Development

The code is pretty laid-out, all commands are under [`commands`](./src/commands/) and settings-related code is under [`settings`](./src/settings/).

> [!NOTE]
>
> When the code is not `--release` mode, the used `.env` file will default to the local file, instead of the one under home directory, and launcher updates
> will be disabled so that you can work on your launcher without version mismatches.

### Documentation

To see the launcher's internal documentation you can run:

```sh
cargo doc --open --no-deps --document-private-items
```

## Uninstallation

You can uninstall the launcher binary along with the environment files and compute node binaries with the `uninstall` command:

```sh
dkn-compute-launcher uninstall
```

> [!CAUTION]
>
> Make sure you backup your private key within `.env` before removing these files, so that you do not lose your hard-earned $DRIA points!

## License

This project is licensed under the [Apache License 2.0](https://opensource.org/license/Apache-2.0).