# macOS

## Overview

This guide explains how to install and run CodeAssist on macOS.

{% hint style="success" %}
This guide is compatible with both Intel and ARM (Apple Silicon, i.e., M1/M2/M3/M4) macOS devices.&#x20;
{% endhint %}

### Prerequisites

Before installing CodeAssist, make sure you have:

* macOS 12 (Monterey) or newer
* Administrator 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
brew install uv
```

Alternatively, you can install using a `curl` command if you don't have [Brew](https://brew.sh/) installed.&#x20;

```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](https://docs.gensyn.ai/testnet/rl-swarm) 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="https://1034405018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIcazOdplbOmP4R0T7sG8%2Fuploads%2F1ll1boQRKwIcDwHXx7YK%2Fimage.png?alt=media&#x26;token=a9c199c0-9c23-466c-a43b-1345affbe5ee" 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](https://docs.gensyn.ai/testnet/codeassist/hugging-face-guide) 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](https://docs.gensyn.ai/testnet/codeassist/using-codeassist) for instructions on how to use CodeAssist, any best practices and tips, and what to expect when training models, or visit the [Troubleshooting](https://docs.gensyn.ai/testnet/codeassist/troubleshooting) 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 %}
