How to Set Up and Run Refact WebUI for Code Models

Mar 24, 2023 | Educational

Welcome to the world of Refact, where the art of code completion and chat models meets a user-friendly interface! In this guide, we’ll walk you through the steps to self-host and fine-tune your code models using Refact WebUI. Let’s dive into the details!

Overview of Refact WebUI

Refact WebUI allows you to fine-tune and self-host open-source code models. These models can later be utilized within Refact plugins for seamless code completion and chat functionality.

Step-by-Step Guide to Running Refact Self-Hosted

1. Install Docker

The easiest way to run the self-hosted server is through a pre-built Docker image. First, ensure you have Docker with NVIDIA GPU support installed. You can find the installation guide here.

2. Set Up WSL 2 (For Windows Users)

If you are using Windows, you need to install WSL 2. Here’s a handy guide on how to do that: Install WSL 2.

3. Run the Docker Container

To launch the docker container, execute the following command:

docker run -d --rm --gpus all --shm-size=256m -p 8008:8008 -v refact-perm-storage:perm_storage smallcloud/refact_self_hosting:latest

In this command, perm-storage is a volume mounted inside the container where all configuration files, downloaded weights, and logs are stored.

4. Upgrading the Docker Image

To upgrade the Docker image, run the command below to delete the existing container, then pull the latest image:

docker kill XXX
docker pull smallcloud/refact_self_hosting
docker run ...

5. Accessing the Web GUI

You can now visit http://127.0.0.1:8008 to explore the server’s Web GUI.

How to Work with Docker Commands

Here’s a quick refresher of essential Docker commands:

  • sudo usermod -aG docker your_user – Add yourself to the Docker group to run Docker without sudo (Linux only).
  • docker ps -a – List all containers.
  • docker start XXX & docker stop XXX – Start and stop existing containers.
  • docker logs -f XXX – Display messages from a container.
  • docker rm XXX – Remove a container and all its data (except data inside a volume).
  • docker volume inspect VVV or docker volume rm VVV – Check out or delete a Docker volume.

Setting Up Plugins

To enhance your experience, download the Refact plugin for either VS Code or JetBrains. Once downloaded, configure a custom inference URL at http://127.0.0.1:8008.

Troubleshooting Tips

If you encounter issues while setting up Refact, here are some troubleshooting ideas:

  • Ensure Docker is running correctly with GPU support enabled.
  • Check if your firewall is blocking the server’s access to port 8008.
  • Review logs for specific error messages by using the Docker logs command.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Supported Models

Refact supports a variety of models for code completion, chat, and fine-tuning. Here’s a brief overview:

Refact is free for individuals and small teams under the BSD-3-Clause license. For enterprise use, please contact us.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Remember!

Refact is a powerful tool in your coding arsenal. Enjoy coding, and happy refining!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox