# Linux

## Overview

This guide explains how to install and run CodeAssist on Linux.&#x20;

### Prerequisites

Before installing CodeAssist, make sure you have:

* A compatible Linux distribution (Ubuntu 22.04+ LTS recommended)&#x20;
* Administrator (`sudo`) privileges on your device
* A [Hugging Face](https://huggingface.co/) account for authentication

### Dependencies

CodeAssist requires the following software components:

| Dependency                                        | Purpose                                                | Minimum Version |
| ------------------------------------------------- | ------------------------------------------------------ | --------------- |
| [Docker](https://docs.docker.com/engine/install/) | Runs the isolated CodeAssist container environment     | Latest stable   |
| [Python](https://www.python.org/downloads/)       | Executes the environment management and web UI Scripts | 3.10+           |
| UV                                                | Manages Python dependencies and virtual environments   | Latest stable   |

#### Docker & Python

Install [Docker](https://docs.docker.com/engine/install/) and [Python](https://www.python.org/downloads/) according to the installation steps for your platform.&#x20;

{% hint style="warning" %}
Make sure that Docker is open before trying to run CodeAssist. If this is your first time installing Docker, it should auto-open.

However, if you close or restart your system, **make sure to reopen the Docker desktop application,** or else you will encounter container connection failures.
{% endhint %}

#### UV

To install UV, a lightweight dependency manager used to handle the project's Python environment, use the following command inside your terminal:

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

You can then check if the installation was successful and check the version of UV installed with `uv --version`.

### Installation Steps

1. Open your terminal
2. Clone the CodeAssist repository:

```bash
git clone https://github.com/gensyn-ai/codeassist.git
cd codeassist
```

{% hint style="warning" %}
If you’re also running [RL Swarm](/testnet/rl-swarm.md) or another Docker-based Gensyn project, ensure that `port:3000` is free before launching CodeAssist.
{% endhint %}

#### Run CodeAssist

To open CodeAssist, run the following command in your terminal:

```bash
uv run run.py
```

The first run may take several minutes as Docker builds the environment and downloads required components.&#x20;

{% hint style="warning" %}
To ensure CodeAssist functions optimally, avoid modifying the `compose.yml` file. Editing this file undermines the run script's purpose and may prevent functionalities such as uploading trained models to Hugging Face, interacting with smart contracts, or earning Testnet participation points.
{% endhint %}

<div data-with-frame="true"><figure><img src="/files/BR2E1t62G2WtTI3IcDtV" alt=""><figcaption></figcaption></figure></div>

Once running, CodeAssist automatically launches in your browser. If it doesn't, visit the following localhost URL and open it manually:

```url
http://localhost:3000
```

### Authentication&#x20;

CodeAssist uses Hugging Face tokens for authentication and model uploads.

1. Visit your **Hugging Face profile > Settings > Access Tokens.**
2. Generate a **New Token** with 'Write' access.
3. Copy the token string.
4. When starting CodeAssist, the application will prompt you for the token. Paste it into the terminal or web interface.

{% hint style="info" %}
Read the [Hugging Face Guide](/testnet/codeassist/hugging-face-guide.md) for help setting up a token, what it's used for, and basic troubleshooting.
{% endhint %}

### Next Steps

Once setup is complete, open CodeAssist, pick your first LeetCode-style problem, and start coding!&#x20;

You can view this [comprehensive walkthrough](/testnet/codeassist/using-codeassist.md) for instructions on how to use CodeAssist, any best practices and tips, and what to expect when training models, or visit the [Troubleshooting](/testnet/codeassist/troubleshooting.md) page if you need help setting up CodeAssist.

{% hint style="success" %}
If you need additional support, you can [open a ticket](https://github.com/gensyn-ai/codeassist/issues) or [visit our Discord.](https://discord.com/invite/gensyn)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gensyn.ai/testnet/codeassist/getting-started/linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
