+
+
+
+
\ No newline at end of file
diff --git a/docs/src/content/config.ts b/docs/src/content/config.ts
new file mode 100644
index 000000000..9df91b604
--- /dev/null
+++ b/docs/src/content/config.ts
@@ -0,0 +1,7 @@
+import { defineCollection } from 'astro:content';
+import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
+
+export const collections = {
+ docs: defineCollection({ schema: docsSchema() }),
+ i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
+};
diff --git a/docs/src/content/docs/byok.md b/docs/src/content/docs/byok.md
new file mode 100644
index 000000000..c537513fe
--- /dev/null
+++ b/docs/src/content/docs/byok.md
@@ -0,0 +1,24 @@
+---
+title: "Bring Your Own Key (BYOK)"
+---
+
+## Introduction
+Bring Your Own Key (BYOK) allows users to specify their API keys and select models for chat, completion, and embedding tasks across different AI platforms. This feature enables seamless integration with various services while maintaining control over API keys.
+The Bring Your Own Key (BYOK) feature allows users to specify their API keys and select models for chat, completion, and embedding tasks across various AI platforms. This functionality ensures seamless integration with different services while providing users with control over their API keys.
+
+## Configuration Steps
+
+Select the **Bring Your Own Key** option and click the **Next** button.
+
+
+
+Click on **Edit BYOK file** to open the `bring-your-own-key.yaml` file:
+
+
+
+In the file, specify your API key, model name, and endpoints as necessary.
+
+
+
+## Additional Resources
+For more examples and configurations, please visit the [Refact GitHub repository](https://github.com/smallcloudai/refact-lsp/tree/main/bring_your_own_key).
\ No newline at end of file
diff --git a/docs/src/content/docs/contributing.md b/docs/src/content/docs/contributing.md
new file mode 100644
index 000000000..81cfc9bb6
--- /dev/null
+++ b/docs/src/content/docs/contributing.md
@@ -0,0 +1,5 @@
+---
+title: How to Contribute
+description: A page with a guide on how to contribute to Refact.
+---
+The contribution guide can be found on [GitHub](https://github.com/smallcloudai/refact/blob/main/CONTRIBUTING.md).
\ No newline at end of file
diff --git a/docs/src/content/docs/faq.md b/docs/src/content/docs/faq.md
new file mode 100644
index 000000000..025a226c5
--- /dev/null
+++ b/docs/src/content/docs/faq.md
@@ -0,0 +1,39 @@
+---
+title: FAQ
+description: Frequently Asked Question(s)
+---
+
+### What programming languages do you support?
+
+We support multiple code LLMs, each of them has been trained on different programming languages.
+
+Our own model Refact 1.6B has been trained and works best for the following languages (alphabetical order): Bash, C#, C++, D, Golang, Java, JavaScript, Julia, Lua, Perl, PHP, Python, R, Racket, Ruby, Rust, Scala, Swift, TypeScript.
+Even if the model has not been specifically trained on a particular coding language, it can still make useful suggestions for code in that language.
+
+### What models are under the hood?
+
+We use a combination of our own models and 3rd party models for different functions.
+
+Our own model is Refact 1.6B code LLM. It's State-of-the-art for the size and In addition to regular prompting, this model can infill code in the middle and produce changes to the code by following instructions. Check it out https://huggingface.co/smallcloudai/Refact-1_6B-fim
+
+For chat we use models from the GPT family, you have the option to opt-out of them.
+In the self-hosted version we also have StarCoder, Code Llama and WizardCoder models.
+
+For a full list of our supported models and their functionality, check our [docs](https://docs.refact.ai/supported-models/).
+
+### Do you plan to support more IDEs?
+
+Yes! We already support VS Code and JetBrains. We have plans to support even more IDEs. If you want to contribute to our new plugins, please reach us out in Discord.
+
+### Do you have a self-hosted option?
+Yes. Refact has a free self-hosted version that you can check here.
+
+### Is it possible to fine-tune Refact to the company codebase?
+Yes. Fine-tuning is currently supported in our free self-hosted and Enterprise plans.
+
+### Can I buy Refact license for my company?
+
+Sure! We currently have an Enterprise self-hosted plan and we plan to add team cloud plan soon. If you're interested in purchasing a license for your company, please [contact us](https://refact.ai/contact).
+
+### How can I contribute?
+We welcome contributions! If you're interested in contributing, please check our [GitHub](https://github.com/smallcloudai/refact/).
diff --git a/docs/src/content/docs/features/agent-integrations.md b/docs/src/content/docs/features/agent-integrations.md
new file mode 100644
index 000000000..0da6f6214
--- /dev/null
+++ b/docs/src/content/docs/features/agent-integrations.md
@@ -0,0 +1,51 @@
+---
+title: Agent Integrations
+description: Overview of available integrations for Refact.ai Agent
+---
+
+Integrations help you to manage the access of agent to the tools.
+
+## Available Integrations
+
+The Agent currently supports the following integrations:
+
+- [Chrome](./integrations/chrome) - Browser automation and screenshot capabilities
+- [Shell](./integrations/shell) - Execute terminal commands with user confirmation
+- [Github](./integrations/github) - Interact with GitHub repositories
+- [Gitlab](./integrations/gitlab) - Manage GitLab repositories and issues
+- [PDB](./integrations/pdb) - Python debugger integration
+- [Postgres](./integrations/postgres) - PostgreSQL database interaction
+- [MySQL](./integrations/mysql) - MySQL database management
+- [Command-line Tool](./integrations/cmdline-tool) - Custom command-line tool integration
+- [Command-line Service](./integrations/cmdline-service) - Background service management
+- [Docker](./integrations/docker) - Docker container management
+
+## Configuring Integrations
+
+You can configure the Integrations in two ways:
+
+### 1. Through Chat Interface
+
+Click on the integrations button in the chat:
+
+
+
+
+
+### 2. Through Settings
+
+Access integrations through the settings menu:
+
+
+
+
+
+## Next Steps
+
+Click on any integration in the list above to learn more about its specific configuration and usage.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-chat.md b/docs/src/content/docs/features/ai-chat.md
new file mode 100644
index 000000000..1a0486e22
--- /dev/null
+++ b/docs/src/content/docs/features/ai-chat.md
@@ -0,0 +1,111 @@
+---
+title: AI Chat
+description: A reference page for AI Chat.
+---
+
+You can ask questions about your code in the integrated AI chat, and it can provide you with answers about your code or generate new code for you based on the context of your current file.
+
+### **Context Length**
+Refact analyzes the code up to a certain length to provide suggestions.
+Context length depends on the plan you have chosen for your account:
+- **Free**: 8000 tokens
+- **Pro**: 32000 tokens
+
+## Modes of Operation
+
+With Refact.ai, you have access to three distinct modes that enhance your interaction with the AI chat: **Quick**, **Explore**, and **Agent**.
+
+### Quick Mode
+In **Quick Mode**, the model responds instantly without accessing external tools. This mode is ideal for rapid interactions and quick queries. You can enrich your experience with the following @-commands:
+
+- **@web**: Convert any webpage into plain text for quick summarization and interaction. Simply use `@web` followed by the URL (e.g., `@web https://refact.ai/`) to fetch and convert the content into text that can be used within your chat.
+
+- **@search**: Quickly locate similar code or text within your workspace, directory, or file. Use `@search` followed by your query (e.g., `@search create table`) to find matching content for seamless exploration and interaction.
+
+### Explore Mode
+**Explore Mode** is more advanced than Quick Mode, utilizing exploration tools to gather context about the project before answering questions. This mode automatically employs @-commands such as:
+
+- **@definition**: Fetch definitions of symbols within the codebase.
+
+- **@reference**: Locate usages of specific functions or classes throughout the project.
+
+- **@tree**: View the project structure and navigate through multiple files to understand the context better.
+
+Explore Mode allows for a deeper understanding of the codebase, enabling the model to provide more informed answers.
+
+### Agent Mode
+**Agent Mode** introduces agent capabilities that significantly enhance the way you program. While responses may take longer, this mode offers higher-quality solutions for complex challenges. Key features include:
+
+- **Contextual Awareness**: The model can analyze and understand the broader context of your code, leading to more relevant suggestions and solutions.
+
+- **Task Automation**: Agent Mode can assist in automating repetitive tasks, allowing you to focus on more critical aspects of your project.
+
+- **Complex Problem Solving**: It is designed to tackle intricate programming challenges by leveraging its understanding of the codebase and available resources.
+
+While we are still refining Agent Mode, it already provides valuable assistance for developers looking to enhance their productivity and code quality.
+
+
+## @-commands
+
+This section outlines various commands that can be used in the AI chat. Below you can find information about functionality and usage of each command.
+
+
+
+#### `@help`
+
+- **Description**: Provides information about available commands and their usage.
+- **Usage**: Type `@help`.
+
+#### `@file`
+
+- **Description**: Attaches a file to the chat.
+- **Usage**:
+ - To attach a whole file, use the command followed by the file name, e.g., `@file example.ext`.
+ - To specify a particular section of a file, include the line numbers, e.g., `@file large_file.ext:42` or for a range, `@file large_file.ext:42-56`.
+
+#### `@definition`
+
+- **Description**: Retrieves the definition of a symbol.
+- **Usage**: Type `@definition` followed by the symbol name, e.g., `@definition MyClass`.
+
+#### `@references`
+
+- **Description**: Returns references for a symbol, including usage examples.
+- **Usage**: Type `@references` followed by the symbol name, e.g., `@references MyClass`.
+
+#### `@symbols-at`
+
+- **Description**: Searches for and adds symbols near a specified line in a file to the chat context.
+- **Usage**: Specify both the file and the line number, e.g., `@symbols-at some_file.ext:42`.
+
+#### `@search`
+
+- **Description**: Find similar pieces of code or text using the vector database.
+- **Usage**: Type `@search` followed by your query and scope, e.g., `@search "function definition" workspace`.
+
+#### `@tree`
+
+- **Description**: Get a files tree with symbols for the project. Use it to get familiar with the project, file names, and symbols.
+- **Usage**: Type `@tree` followed by an optional path, e.g., `@tree some_directory/`.
+
+#### `@web`
+
+- **Description**: Fetch a web page and convert to readable plain text.
+- **Usage**: Type `@web` followed by the URL, e.g., `@web http://example.com`.
+
+## Chat Initialization Options
+
+Upon starting a new chat, several options are available that mimic the above commands:
+
+- `Search workspace`: Equivalent to using `@search`. It uses the entered query to perform a search.
+- `Attach current_file.ext`: Similar to the `@file` command. It attaches the file at the current cursor position (CURSOR_LINE), useful for dealing with large files.
+- `Lookup symbols`: Corresponds to the `@symbols-at` command. It extracts symbols around the cursor position and searches them in the AST index.
+- `Selected N lines`: Adds the currently selected lines as a snippet for analysis or modification. This is similar to embedding code within backticks ``` in the chat.
+
+## Enabling commands
+
+To use @-commands in the AI chat, you need to enable specific settings:
+- `@search` - enable the `Enable vector database` checkbox under the `Refactai: Vecdb` section.
+- `@definition`, `@file`, `@references`, `@symbols-at` - enable the `Enable syntax parsing` checkbox under the `Refactai: Ast` section.
+
+Read more in the [Enabling RAG Documentation](https://docs.refact.ai/features/context/).
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-toolbox.md b/docs/src/content/docs/features/ai-toolbox.md
new file mode 100644
index 000000000..d3ddf43d9
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox.md
@@ -0,0 +1,65 @@
+---
+title: AI Toolbox
+description: A page about functions in the Refact AI Toolbox
+---
+
+Refact.ai Toolbox is a set of functions that can be used to
+refactor, analyze, and improve your code.
+
+The Toolbox can be accessed by pressing `Alt+T`. It will open a modal
+window associated with a specific line of code or a block of code.
+
+At the moment, AI Toolbox only works with VS Code.
+
+The following commands are available in the Toolbox:
+- `/bugs` - Find and fix bugs in your code
+- `/comment` - Comment each line
+- `/edit` - Edit code. You need to write instructions after the command
+- `/explain` - Explain code
+- `/gen` - Create new code. You need to add a description after the command
+- `/improve` - Rewrite this specific code block to improve it
+- `/naming` - Improve variables, functions, classes, etc.
+- `/shorter` - Make code shorter
+- `/summarize` - Summarize code in one paragraph
+- `/typehints` - Add type hints
+- `/typos` - Find and fix typos in code
+
+
+## Custom toolbox commands
+
+You can also create your own toolbox commands. To do that, you need to press
+`Alt+T` and type `/help` in the Refact.ai console. At the bottom, you will see a
+button called `Customize toolbox`. Press it and the `customization.yaml`
+file will open.
+
+
+
+In the file, you will find a `toolbox_commands` section. You can add your
+custom commands there.
+
+All of the newly created commands should follow the same format:
+
+```yaml
+description: "User-defined: translate to horrible code"
+ selection_needed: [1, 50]
+ messages:
+ - role: "system"
+ content: "%DEFAULT_PROMPT%"
+ - role: "user"
+ content: "@file %CURRENT_FILE%:%CURSOR_LINE%\nRewrite this specific code block into a very inefficient and cryptic one, but still correct. Rename variables to misleading gibberish. Add unnecessary complexity. Make O(N) worse. Don't forget about bad formatting and random spaces.\n\n```\n%CODE_SELECTION%```\n"
+```
+
+To break it down, you need to provide the following information:
+- `description` - a user-defined description of the command
+- `selection_needed` - a list of line numbers that the command is valid for
+- `content` - Inside the `message` for the `user` role, the exact prompt that will be used when the command is executed
+
+Once you finish, save the file, and your custom toolbox command will be available.
+When entering the `/help` command, you will see your custom command in the list of available commands.
+
+
+
+
+:::note
+When using toolbox commands without the `/` symbol, the command will be executed in the chat interface. Also, the command will be executed in the toolbox window.
+:::
diff --git a/docs/src/content/docs/features/ai-toolbox/comments.md b/docs/src/content/docs/features/ai-toolbox/comments.md
new file mode 100644
index 000000000..4cd518bdd
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox/comments.md
@@ -0,0 +1,6 @@
+---
+title: Comments
+description: A page about comments feature.
+---
+
+Refact will add a comment to each line of code.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-toolbox/debug.md b/docs/src/content/docs/features/ai-toolbox/debug.md
new file mode 100644
index 000000000..add79e251
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox/debug.md
@@ -0,0 +1,6 @@
+---
+title: Add Console Logs
+description: A reference page for the debugging feature.
+---
+
+Refact will add console statements to the selected code.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-toolbox/explain-code.md b/docs/src/content/docs/features/ai-toolbox/explain-code.md
new file mode 100644
index 000000000..3963daa1a
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox/explain-code.md
@@ -0,0 +1,12 @@
+---
+title: Explain Code
+description: A page about the explain code feature.
+---
+
+You see a piece of code you don't completely understand?
+
+Function, method or just a piece of code that looks complex, unclear and needs an explanation
+
+Select a block of code or an entire function body.
+
+This adds a block of comments with an explanation immediately after the selected lines.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-toolbox/fix-bugs.md b/docs/src/content/docs/features/ai-toolbox/fix-bugs.md
new file mode 100644
index 000000000..be2459056
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox/fix-bugs.md
@@ -0,0 +1,10 @@
+---
+title: Fix Bugs
+description: A page about fix bugs feature.
+---
+
+Works best for:
+
+- Subtle syntax bugs
+- Wrong identifier used, broken expressions or similar
+- Misuse of common APIs
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-toolbox/improve-code.md b/docs/src/content/docs/features/ai-toolbox/improve-code.md
new file mode 100644
index 000000000..bec067f13
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox/improve-code.md
@@ -0,0 +1,13 @@
+---
+title: Improve Code
+description: A page about improve code feature.
+---
+
+Do you have a piece of code that needs to be shorter and be more clear?
+
+Works best for:
+- Nested ifs
+- Verbose or unclear code
+- Complex conditions or expressions
+
+Select a block of code or an entire function body.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/ai-toolbox/naming.md b/docs/src/content/docs/features/ai-toolbox/naming.md
new file mode 100644
index 000000000..2fd9e1f77
--- /dev/null
+++ b/docs/src/content/docs/features/ai-toolbox/naming.md
@@ -0,0 +1,8 @@
+---
+title: Precise naming
+description: A page about precise naming feature.
+---
+
+Refact can improve the names of variables and make them less generic.
+
+It will rename variables within the selected lines.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/getting-started.md b/docs/src/content/docs/features/autonomous-agent/getting-started.md
new file mode 100644
index 000000000..c7195ee48
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/getting-started.md
@@ -0,0 +1,42 @@
+---
+title: How to Start Using Refact.ai Agent
+description: A step-by-step guide to start using the Refact.ai Agent in your IDE
+---
+
+Getting started with Refact.ai Agent is simple and straightforward. Follow these steps to begin using the autonomous agent capabilities:
+
+## Step 1: Open Refact.ai Chat
+Launch the Refact.ai Chat interface in your IDE.
+
+
+
+
+
+## Step 2: Choose Agent Mode
+Select the Agent Mode from the available options.
+
+
+
+
+
+## Step 3: Write Your Prompt
+Start interacting with the agent by writing your prompt and watch the magic happen!
+
+
+
+
+
+## Tips for Getting Started
+- Be specific in your prompts for better results
+- Start with simple tasks to understand the agent's capabilities
+- Experiment with different types of requests to learn what works best
+- Pay attention to the agent's feedback and suggestions
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/chrome.md b/docs/src/content/docs/features/autonomous-agent/integrations/chrome.md
new file mode 100644
index 000000000..6ad3c123f
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/chrome.md
@@ -0,0 +1,101 @@
+---
+title: Chrome Tool
+description: Configure and use the Chrome Tool for web interactions
+---
+
+The Chrome Tool enables the Refact.ai Agent to interact with browsers like Chrome, Chromium, and Edge. This integration allows the agent to open links and take screenshots to extract additional context for your tasks.
+
+## Functionality
+
+### Enable Toggle
+- Allows you to activate or deactivate the Chrome Tool
+- When toggled on, the tool is ready for use; toggling off disables its functionality
+
+### Delete Button
+- Permanently removes the Chrome Tool from your list of integrations
+- Use this if you no longer need the tool
+
+### Test
+- Opens a chat interface and tests whether the Chrome Tool is correctly configured
+- If successful, it confirms that the tool is ready to use
+
+### Help Me Install Chrome for Testing
+- Launches a chat to guide you through configuring the tool automatically by identifying the browser path
+- β οΈ Note: This process doesn't always work flawlessly β think of it as the model taking a stab at finding the path on your behalf (sometimes it hits the mark, sometimes it doesn't)
+
+## Configuration Instructions
+
+### Find the Browser Path
+The process for identifying the browser path depends on your operating system. Here are typical paths:
+
+- Windows: `C:\Program Files\Google\Chrome\Application\chrome.exe`
+- MacOS: `/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`
+- Linux: `/usr/bin/google-chrome` or `/usr/bin/chromium`
+
+### Inserting the Path
+1. Copy the full path to your browser executable
+2. Paste it into the Chrome Path field
+3. Click Apply to save the configuration
+
+## Advanced Configuration Options
+
+### Idle Browser Timeout
+- Sets the time (in seconds) the browser can remain idle before being closed automatically
+- Default: 300 seconds
+
+### Headless Mode
+- When enabled, Chrome runs in "headless" mode (no visible browser window)
+- Default: true (enabled)
+
+### Window Dimensions and Scale Factors
+Configure the size and scaling for different device views:
+
+#### Desktop
+- Window Width: 1280 (default)
+- Window Height: 800 (default)
+- Scale factor: 1 (default)
+
+#### Mobile
+- Window Width: 667 (default)
+- Window Height: 375 (default)
+- Scale Factor: 1 (default)
+
+#### Tablet
+- Window Width: 768 (default)
+- Window Height: 1024 (default)
+- Scale Factor: 1 (default)
+
+## Usage Examples
+
+### Opening Web Links
+
+
+
+ You can ask the Agent to:
+ - Open any URL and take a screenshot
+ - Navigate to specific elements on a page
+ - Interact with web content
+
+
+
+
+
+
+### Local File Access
+
+
+
+ The Agent can also:
+ - Open locally hosted websites
+ - Take screenshots
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/command-line-service.md b/docs/src/content/docs/features/autonomous-agent/integrations/command-line-service.md
new file mode 100644
index 000000000..0b65cab85
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/command-line-service.md
@@ -0,0 +1,38 @@
+---
+title: Command Line Service
+description: Configure and use command-line services and background processes
+---
+
+The Command-Line Service integration allows you to adapt command-line tools that run as background processes, such as web servers or daemons. This tool provides options to monitor the service's startup, specify parameters, and manage interactions with the Refact.ai Agent.
+
+## Basic Configurations
+
+### Command Settings
+- **Command**: Specify the command to execute
+ - Use `%param_name%` notation to allow dynamic parameter substitution by the model
+ - Example: `python -m http.server %port%`
+- **Command Workdir**: Define the working directory for the command
+ - If left empty, the workspace directory will be used by default
+- **Description**: Provide a description to explain the purpose of this service
+
+### Parameters
+- Add parameters the model should fill out when using the tool
+- Define a Name and Description for each parameter to guide the model
+
+### Startup Configuration
+- **Startup Wait Port**: Specify a port for the tool to monitor during startup
+ - The service will wait for the port to become active as an indication that the process has started successfully
+- **Startup Wait**: Set the maximum time (in seconds) the tool should wait for the service to start
+ - If the process doesn't start within this time, it will be terminated
+- **Startup Wait Keyword**: Define a keyword to monitor in the service's output
+ - The service will wait until the keyword appears to confirm the startup
+
+### Actions
+- **Test**: Runs the command to verify its functionality
+- **Auto Configure**: Assists in setting up the service by analyzing the context
+
+### Confirmation Rules
+Define rules to control execution:
+- **Ask User**: Commands matching these patterns will prompt the user for confirmation
+- **Deny**: Commands matching these patterns are automatically blocked
+ - Example: `sudo*`: Blocks commands requiring elevated privileges
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/command-line-tool.md b/docs/src/content/docs/features/autonomous-agent/integrations/command-line-tool.md
new file mode 100644
index 000000000..23950509e
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/command-line-tool.md
@@ -0,0 +1,44 @@
+---
+title: Command Line Tool
+description: Configure and use custom command-line tools
+---
+
+The Command-Line Tool integration allows you to add and adapt any command-line tool for use by the Refact.ai Agent. This tool can be configured with specific parameters, commands, and restrictions, enabling tailored functionality for your workflows.
+
+## Basic Configurations
+
+### Command Settings
+- **Command**: Specify the command to execute
+ - Use `%param_name%` notation to allow dynamic parameter substitution by the model
+ - Example: `echo %message%`
+- **Command Workdir**: Define the working directory for the command
+ - If left empty, the workspace directory will be used by default
+- **Description**: Provide a description to explain the purpose of this command
+ - This helps the Refact.ai Agent understand when and why to use the tool
+
+### Parameters
+- Add parameters the model should fill out when using the tool
+- Define a Name and Description for each parameter to guide the model
+
+### Timeout
+- Set the maximum time (in seconds) the command is allowed to run
+- If the command exceeds this duration, it will be terminated, and its output (stdout/stderr) will be returned
+
+### Actions
+- **Test**: Runs the command to verify its functionality
+- **Auto Configure**: Assists in setting up the command by analyzing the context and suggesting configurations
+
+## Advanced Configuration
+
+### Output Filter
+Manage how the command's output is processed and displayed:
+- Limit the number of lines or characters in the output
+- Prioritize output from the start (top) or end (bottom)
+- Use regular expressions (regex) to extract relevant portions of the output
+- Remove unwanted parts of the output for cleaner results
+
+### Confirmation Rules
+Define rules to control execution:
+- **Ask User**: Commands matching these patterns will prompt the user for confirmation before execution
+- **Deny**: Commands matching these patterns are automatically blocked
+ - Example: `sudo*`: Blocks commands requiring elevated privileges
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/docker.md b/docs/src/content/docs/features/autonomous-agent/integrations/docker.md
new file mode 100644
index 000000000..75e181caa
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/docker.md
@@ -0,0 +1,38 @@
+---
+title: Docker Tool
+description: Configure and use Docker integration
+---
+
+The Docker Tool integration enables interaction with Docker containers, allowing the Refact.ai Agent to manage, query, and modify Docker environments. This tool supports local and remote Docker configurations.
+
+## Basic Configurations
+
+### Docker Settings
+- **Docker CLI Path**: Specify the path to the Docker CLI executable
+ - Default: `docker`
+- **Label**: Define a label to identify the Docker containers managed by the tool
+ - Example: `refact`
+
+### Actions
+- **Test**: Verifies the connection and functionality of the Docker integration
+
+## Advanced Configuration
+
+### Docker Connection
+- **Docker Daemon Address**: Specify the address for connecting to the Docker daemon
+ - Leave blank to use the default local daemon
+
+### Remote Docker
+Enable this option to connect to a remote Docker host using SSH:
+- **SSH Host**: Specify the hostname or IP address of the remote Docker host
+- **SSH User**: Define the user for the SSH connection
+- **SSH Port**: Default: 22
+- **SSH Identity File**: Provide the path to the SSH identity file for authentication
+
+### Confirmation Rules
+Define rules to control execution:
+- **Ask User**: Commands matching these patterns will prompt the user for confirmation
+- **Deny**: Commands matching these patterns are automatically blocked
+ - Examples:
+ - `docker* rm *`: Blocks removal of containers
+ - `docker* stop *`: Blocks stopping containers
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/github.md b/docs/src/content/docs/features/autonomous-agent/integrations/github.md
new file mode 100644
index 000000000..60b93a054
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/github.md
@@ -0,0 +1,42 @@
+---
+title: GitHub Tool
+description: Configure and use GitHub integration
+---
+
+The GitHub Tool integration enables interaction with GitHub repositories through the GitHub CLI. This integration supports various GitHub operations, including creating issues, managing pull requests, and more.
+
+## Basic Configurations
+
+### Scope of Configuration
+You can configure the GitHub integration for:
+- **Global**: Makes the integration available across all projects
+- **Project-Specific**: Limits the integration to a single project, allowing for customized settings
+
+### Personal Access Token
+- The tool requires a GitHub Personal Access Token for authentication
+- You can create a token directly from your GitHub account
+- To enhance security, you can store the token in a secrets.yaml file and reference it with `$MY_SECRET_VARIABLE`
+
+### Continue Setup
+After choosing the scope and providing the token, proceed with the setup to finalize the integration.
+
+## Advanced Configuration
+
+### Actions
+- Use the Test button to verify if the GitHub integration is functioning correctly
+
+### Confirmation Rules
+Define command patterns to control execution and safeguard critical operations:
+
+#### Ask User
+Commands requiring confirmation, examples:
+- `gh * delete *`: Prompts confirmation for delete operations
+- `gh * close *`: Prompts confirmation for closing issues or pull requests
+
+#### Deny
+Commands to block, example:
+- `gh auth token *`: Blocks authentication token commands for security
+
+### Token Management
+- If the token is stored as an environment variable, ensure it is referenced correctly
+- The system uses this token to authenticate GitHub operations without directly exposing it
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/gitlab.md b/docs/src/content/docs/features/autonomous-agent/integrations/gitlab.md
new file mode 100644
index 000000000..bc9017048
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/gitlab.md
@@ -0,0 +1,34 @@
+---
+title: GitLab Tool
+description: Configure and use GitLab integration
+---
+
+The GitLab Tool integration allows interaction with GitLab repositories using the GitLab CLI. This integration supports various GitLab operations, such as creating issues, managing merge requests, and more.
+
+## Basic Configurations
+
+### Glab Token
+- The tool requires a GitLab Personal Access Token for authentication
+- You can generate a token directly from your GitLab account
+- To enhance security, store the token in a secrets.yaml file and reference it with `$MY_SECRET_VARIABLE`
+
+### Actions
+- Use the Test button to verify if the GitLab integration is functioning correctly
+
+## Advanced Configuration
+
+### Glab Binary Path
+- Specifies the path to the GitLab CLI binary (glab)
+- Leave this field empty to use the default glab command if it is available in your system's PATH
+- On Windows, if you experience issues, install glab via Chocolatey, Winget, or from the official GitLab website
+
+### Confirmation Rules
+Define command patterns to control execution and safeguard critical operations:
+
+#### Ask User
+Commands requiring confirmation, example:
+- `glab * delete *`: Prompts confirmation for delete operations
+
+#### Deny
+Commands to block, example:
+- `glab auth token *`: Blocks authentication token commands for security
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/index.md b/docs/src/content/docs/features/autonomous-agent/integrations/index.md
new file mode 100644
index 000000000..e454d80ba
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/index.md
@@ -0,0 +1,46 @@
+---
+title: Agent Integrations
+description: Overview of available integrations for the Refact.ai Agent
+---
+
+The Refact.ai Agent supports various integrations to enhance your development workflow. These integrations extend the Agent's [core tools](../tools) with external services and capabilities.
+
+## Development Tools
+- [Chrome](./chrome) - Control Chrome browser for testing
+- [Command-line Tool](./command-line-tool) - Configure and use custom command-line tools
+- [Command-line Service](./command-line-service) - Run and manage background processes
+- [Shell Commands](./shell-commands) - Execute terminal commands with user confirmation
+
+## Version Control
+- [GitHub](./github) - Interact with GitHub repositories through GitHub CLI
+- [GitLab](./gitlab) - Work with GitLab repositories using GitLab CLI
+
+## Container Management
+- [Docker](./docker) - Manage Docker containers and environments
+
+## Databases
+- [PostgreSQL](./postgresql) - Work with PostgreSQL databases
+- [MySQL](./mysql) - Work with MySQL databases
+
+## Debugging
+- [Pdb](./pdb) - Allows interaction with the Python debugger
+
+Each integration can be configured and customized to suit your specific needs. Click on the links above to learn more about each integration's features and configuration options.
+
+## Configuring Integrations
+
+You can configure the integrations in two ways:
+
+### 1. Through Chat Interface
+
+Click on the integrations button in the chat interface to quickly enable or disable specific integrations.
+
+### 2. Through Settings
+
+Access integrations through the settings menu for more detailed configuration options.
+
+## Next Steps
+
+- Review our [security best practices](../security) when setting up integrations
+- Learn about [authentication methods](../authentication) for different services
+- Check the [troubleshooting guide](../troubleshooting) if you encounter any issues
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/mysql.md b/docs/src/content/docs/features/autonomous-agent/integrations/mysql.md
new file mode 100644
index 000000000..04f06ce1f
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/mysql.md
@@ -0,0 +1,31 @@
+---
+title: MySQL Tool
+description: Configure and use MySQL database integration
+---
+
+The MySQL Tool integration allows the AI model to interact with MySQL databases, enabling it to query, inspect data, and make changes. This tool can also integrate with Docker containers running MySQL servers.
+
+## Basic Configurations
+
+### Connection Settings
+- **Host**: Specify the host to connect to, such as 127.0.0.1 or the name of a Docker container
+- **Port**: Define the port used for the connection (Default: 3306)
+- **User and Password**: Set the username and password for database access
+ - Can be entered directly or referenced from environment variables (e.g., `$MYSQL_USER` and `$MYSQL_PASSWORD`)
+- **Database**: Enter the name of the database you want the tool to connect to
+
+### Actions
+- **Test**: Verifies the connection and functionality of the MySQL integration
+- **Look at the project, help me set it up**: Assists in configuring the tool by analyzing project settings
+
+## Advanced Configuration
+
+### MySQL Binary Path
+- Specifies the path to the mysql binary
+- Leave this field blank if mysql is available in the system's PATH
+- If the binary is located elsewhere, provide the full path (e.g., `/usr/local/bin/mysql`)
+
+### Confirmation Rules
+Define command patterns to control execution:
+- **Ask User**: Commands matching these patterns will prompt the user for confirmation before execution
+- **Deny**: Commands matching these patterns are automatically blocked
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/pdb.md b/docs/src/content/docs/features/autonomous-agent/integrations/pdb.md
new file mode 100644
index 000000000..c3cad5a2f
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/pdb.md
@@ -0,0 +1,23 @@
+---
+title: PDB Tool
+description: Configure PDB
+---
+
+## PDB Tool
+
+The PDB Tool integration allows interaction with the Python debugger for inspecting variables and exploring program execution. It provides functionality for debugging Python scripts and applications.
+
+### Configurations
+
+#### Python Interpreter Path
+- Specifies the path to the Python interpreter
+- Leave this field empty to use the default python3 command
+- If the Python executable is located in a non-standard directory, provide its full path
+
+#### Actions
+- Use the Test button to verify if the PDB integration is functioning correctly
+
+#### Confirmation Rules
+Define command patterns to control execution:
+- **Ask User**: Commands matching these patterns will prompt the user for confirmation before execution
+- **Deny**: Commands matching these patterns are automatically blocked
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/postgresql.md b/docs/src/content/docs/features/autonomous-agent/integrations/postgresql.md
new file mode 100644
index 000000000..c9033cac1
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/postgresql.md
@@ -0,0 +1,32 @@
+---
+title: PostgreSQL Tool
+description: Configure and use PostgreSQL database integration
+---
+
+The PostgreSQL Tool integration allows the Refact.ai Agent to interact with Postgres databases, enabling it to query, inspect data, and make changes. This tool can also integrate with Docker containers running Postgres servers.
+
+## Basic Configurations
+
+### Connection Settings
+- **Host**: Specify the host to connect to, such as 127.0.0.1 or the name of a Docker container
+- **Port**: Define the port used for the connection (Default: 5432)
+- **User and Password**: Set the username and password for database access
+ - Can be entered directly or referenced from environment variables (e.g., `$POSTGRES_USER` and `$POSTGRES_PASSWORD`)
+- **Database**: Enter the name of the database you want the tool to connect to
+
+### Actions
+- **Test**: Verifies the connection and functionality of the Postgres integration
+- **Look at the project, help me set it up**: Assists in configuring the tool by analyzing project settings
+
+## Advanced Configuration
+
+### PSQL Binary Path
+- Specifies the path to the psql binary
+- Leave this field blank if psql is available in the system's PATH
+- If the binary is located elsewhere, provide the full path (e.g., `/usr/local/bin/psql`)
+
+### Confirmation Rules
+Define command patterns to control execution:
+- **Ask User**: Commands requiring confirmation, example:
+ - `psql*[!SELECT]*`: Prompts for confirmation for commands other than SELECT
+- **Deny**: Commands matching these patterns are automatically blocked
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/integrations/shell-commands.md b/docs/src/content/docs/features/autonomous-agent/integrations/shell-commands.md
new file mode 100644
index 000000000..f2035f3e2
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/integrations/shell-commands.md
@@ -0,0 +1,43 @@
+---
+title: Shell Tool
+description: Configure and use the Shell Tool for command-line operations
+---
+
+The Shell Tool allows the Refact.ai Agent to execute any command-line tool with user confirmation directly from the chat interface. This integration is ideal for automating tasks while ensuring safety and user control.
+
+## Basic Configurations
+
+### Timeout
+- Specifies the maximum time (in seconds) that a command is allowed to run
+- If the command exceeds this time, it is automatically terminated
+- Any output (stdout/stderr) is collected and presented to the user
+
+### Confirmation Rules
+Provides a safety mechanism for executing potentially destructive or sensitive commands:
+
+#### Ask User
+- Commands matching patterns in this list will prompt the user for confirmation before execution
+- By default, the wildcard (*) matches all commands
+
+#### Deny
+- Commands matching patterns in this list will be automatically blocked
+- Example: `sudo*` blocks commands requiring elevated privileges
+
+Users can add or remove rows to customize these rules according to their preferences and security requirements.
+
+## Advanced Configuration Options
+
+### Output Filter
+Controls how the output of executed commands is processed and displayed:
+
+#### Basic Limits
+- **Limit Lines**: Restricts the output to a specified number of lines (e.g., 100)
+- **Limit Characters**: Restricts the output to a maximum number of characters (e.g., 10,000)
+
+#### Output Processing
+- **Valuable Top or Bottom**: Determines whether the tool prioritizes the start (top) or end (bottom) of the output for relevance
+- **Grep**: Uses a regular expression (e.g., `(?i)error`) to filter and highlight specific content in the output
+- **Grep Context Lines**: Defines the number of surrounding lines to include with matches from the grep filter
+- **Remove from Output**: Allows for removing unwanted patterns or content from the displayed output
+
+These settings help manage large or verbose outputs, focusing only on the most critical information.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/overview.md b/docs/src/content/docs/features/autonomous-agent/overview.md
new file mode 100644
index 000000000..2820f0beb
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/overview.md
@@ -0,0 +1,61 @@
+---
+title: Agent Overview
+description: Comprehensive overview of Refact.ai Agent capabilities and features
+---
+
+Refact.ai Agent is now available, bringing autonomous capabilities to your development workflow. The agent can independently gather context, create and edit documents, execute shell commands, and much more.
+
+## Real-time Collaboration
+A standout feature of Refact.ai Agent is its real-time awareness of your actions. The agent automatically stays in sync with your codebase, eliminating the need to manually provide context about recent changes.
+
+Watch how our Agent can read and understand recently created files:
+
+
+
+
+
+## Autonomous Patching
+Refact.ai Agent can autonomously create and edit files. The process works in two steps:
+
+1. The Agent provides the code changes it wants to make
+2. You approve the "Patches" before they're applied
+
+Watch how Refact.ai Agent is rewrite file from python to php:
+
+
+
+
+You can streamline the process by enabling automatic patch approval.
+Toggle the "Allow Patches" option to let the Agent make changes without requiring permission each time:
+
+
+
+
+
+## Shell Command Execution
+
+
+
+ The Agent can execute terminal commands on your behalf
+
+
+
+
+
+
+See an example of the Agent creating a virtual environment and installing numpy.
+
+
+For setup instructions, visit the [Agent Integrations](/features/autonomous-agent/integrations/) page.
diff --git a/docs/src/content/docs/features/autonomous-agent/rollback.md b/docs/src/content/docs/features/autonomous-agent/rollback.md
new file mode 100644
index 000000000..ff6a4eca9
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/rollback.md
@@ -0,0 +1,58 @@
+---
+title: Agent Rollback
+description: Learn how to use Refact.ai Agent's rollback functionality to revert repository changes
+---
+
+The Refact.ai Agent provides a powerful rollback feature that allows you to revert your repository to the state it was in at any specific point in your chat conversation. This feature is particularly useful when experimenting with different solutions or when you need to undo a series of changes.
+
+## Overview
+
+The rollback functionality enables you to:
+- Return to any previous state in your development session
+- Review changes before applying the rollback
+- Maintain a clear history of your development process
+
+## Enabling Rollback
+
+The rollback feature is enabled by default in Agent chat mode. However, you should verify that the toggle is properly set:
+
+
+
+
+
+## Using Rollback
+
+To rollback to a specific point in your conversation:
+
+1. Navigate to the message you want to rollback to in the chat history
+2. Look for the rollback icon next to the message
+3. Click the icon to initiate the rollback process
+4. Review the summary of changes that will occur
+5. Confirm the rollback if you agree with the changes
+
+Here's how to use the rollback feature:
+
+
+
+
+
+## Important Considerations
+
+:::caution[Warning]
+Any changes made to your repository after the selected message point will be removed during rollback. This includes:
+- Changes made by the Agent
+- Manual changes you've made
+- Any file modifications or additions
+:::
+
+## Next Steps
+
+- Learn about [Agent Tools](../tools) to better understand how changes are made
+- Explore [Agent Integrations](../integrations) for enhanced development workflow
+- Check out the [FAQ](/faq) for common questions about Agent features
\ No newline at end of file
diff --git a/docs/src/content/docs/features/autonomous-agent/tools.md b/docs/src/content/docs/features/autonomous-agent/tools.md
new file mode 100644
index 000000000..c80746a33
--- /dev/null
+++ b/docs/src/content/docs/features/autonomous-agent/tools.md
@@ -0,0 +1,94 @@
+---
+title: Agent Tools
+description: Overview of available tools and use cases for the autonomous Refact.ai Agent
+---
+
+The Refact.ai Agent is designed to operate autonomously, extending its capabilities beyond simple integrations. While integrations allow external services to be connected, Agent Tools empower the agent to perform key operations using built-in functionalities. Below is an overview of the available Agent Tools, typical use cases, and how they can enhance your development workflow.
+
+## Core Tools
+
+The Agent has access to several powerful tools that help it understand and modify your codebase:
+
+### Context and Search Tools
+
+- **search**
+ Find similar pieces of code or text using vector database.
+ *Use Case:* When you ask the Agent to modify code, it uses this tool to find similar patterns across your codebase to maintain consistency.
+
+- **definition**
+ Read definition of symbols in the project using AST.
+ *Use Case:* The Agent uses this to understand function signatures, class structures, and type definitions when working with your code.
+
+- **references**
+ Find usages of symbols within the project using AST.
+ *Use Case:* Before modifying a function or class, the Agent checks all its usages to ensure changes won't break existing code.
+
+- **tree**
+ Get a files tree with symbols for the project.
+ *Use Case:* The Agent uses this to understand project structure and locate relevant files.
+
+### File Operations
+
+- **cat**
+ Read multiple files and understand their content.
+ *Use Case:* The Agent can read and analyze multiple files at once, including images and skeletonized code views.
+
+- **locate**
+ Find relevant files for a specific task.
+ *Use Case:* When given a task, the Agent can quickly identify which files need to be modified.
+
+### Code Modification
+
+- **patch**
+ Apply changes to files in a controlled manner.
+ *Use Case:* The Agent uses this to make actual changes to your codebase, with your approval.
+
+### Planning and Analysis
+
+- **think**
+ Analyze complex problems and create execution plans using o3 mini reasoning model.
+ *Use Case:* Before making changes, the Agent plans out the steps needed to complete a task successfully. The o3 mini model helps break down complex problems into manageable steps and create a clear execution strategy.
+
+### Web Interaction
+
+- **web**
+ Fetch and read web pages in plain text format.
+ *Use Case:* The Agent can read documentation, specifications, or other web resources to help solve problems.
+
+## How Agent Tools Work Together
+
+The Agent combines these tools strategically to complete complex tasks. Here's a typical workflow:
+
+1. **Understanding Phase**
+ - Uses `tree` to understand project structure
+ - Uses `locate` to find relevant files
+ - Uses `search` to find similar patterns
+ - Uses `definition` and `references` to understand code context
+
+2. **Planning Phase**
+ - Uses `think` to create a detailed plan
+ - Uses `web` if external documentation is needed
+
+3. **Execution Phase**
+ - Uses `cat` to read necessary files
+ - Creates changes using `patch` tool
+ - Verifies changes using `search` and `references`
+
+## Best Practices
+
+When working with the Agent, consider these tips:
+
+- Let the Agent gather context before making changes
+- Review proposed patches carefully before approving
+- Use the Agent's planning capabilities for complex tasks
+- Provide clear, specific instructions for best results
+
+## Next Steps
+
+Once you're familiar with the core tools, you might want to explore:
+
+- [Agent Overview](../overview) - Learn more about the Agent's capabilities
+- [Getting Started](../getting-started) - Start using the Agent effectively
+- [Integrations](../integrations) - Connect with external services and tools
+
+For specific integration guides and advanced usage scenarios, refer to our detailed documentation sections.
\ No newline at end of file
diff --git a/docs/src/content/docs/features/code-completion.md b/docs/src/content/docs/features/code-completion.md
new file mode 100644
index 000000000..eba9a6775
--- /dev/null
+++ b/docs/src/content/docs/features/code-completion.md
@@ -0,0 +1,72 @@
+---
+title: Code Completion
+description: A reference page for code completion.
+---
+
+Refact offers a powerful AI-driven code completion feature.
+
+## How It Works
+
+Refact utilizes a technique called **Fill-in-the-middle** (FIM), where the context before and after your cursor is considered to predict and insert the most relevant code snippets.
+
+## Code Completion Models
+
+- **Cloud Version**: The cloud version of Refact uses the `Refact-1.6-fim` and `starcoder2/3b` model.
+- **Self-Hosted Version**: If you opt for the self-hosted version, you have the flexibility to choose from a variety of models. For a detailed list of available models, refer to the [Supported Models](https://docs.refact.ai/supported-models/) section of the documentation.
+- **Enterprise Version**: The enterprise version of Refact allows you to use the models available in the Self-hosted version and additional vLLM models.
+
+## Key Features
+
+### **Context Length**
+Refact analyzes the code up to a certain length to provide suggestions.
+Context length depends on the plan you have chosen for your account:
+- **Free**: 2048 tokens
+- **Pro**: 4096 tokens
+
+### **Cache Mechanism**
+To enhance performance, Refact caches previous computations and suggestions.
+
+This cache helps in reducing latency and improving the responsiveness of the autocomplete feature, especially during repeated coding patterns or when similar code contexts are encountered.
+
+To avoid cached suggestions, you can press `spacebar`.
+
+**Force completion** is a way to avoid the cached suggestions and trigger the autocomplete feature manually.
+
+### **Force Completion**
+Force completion is a shortcut that can be used to trigger the autocomplete feature manually.
+
+This can be configured in your IDE's keyboard shortcuts settings. The default shortcut is `Alt + Space` on Windows and `Opt + Space` on macOS.
+
+
+## Disabling Code Completion
+
+You can disable code completion by pressing the Refact logo at the status bar and clicking on the `Pause Completion` button.
+
+
+
+## Privacy
+
+Privacy settings allow you to control the level of confidentiality to ensure the confidentiality of your code.
+
+There are three levels of privacy you can choose from in Refact.
+Levels of privacy can be modified in the plugin dashboard.
+### Level 0
+With this level of privacy, Refact will not have access to files and data won't be sent to a third-party model.
+
+> With this level of privacy you won't be able to use any of the Refact commands like `Explain code` or `Completion`
+
+### Level 1
+With Level 1 of privacy, Refact has access to your files but data is protected from sending to a third-party model.
+
+At Refact, your privacy and control over your data are fundamental principles that guide our approach. We are committed to providing a secure and reliable environment for all our users, whether you choose to utilize our cloud services or set up a self-hosted server. Your trust is important to us, and we're here to support your coding journey while safeguarding your data every step of the way.
+
+When working with code blocks that use third-party APIs you will receive an error that indicates you need to switch to a Level 2 privacy in order to get a precise analysis of the code.
+
+#### Refact Cloud Version
+When using Refact's cloud version, data is sent to our servers for processing. However, it's important to note that we do not collect datasets on the server side. Your code and information are used solely to enhance your coding experience and provide you with intelligent suggestions.
+
+#### Refact Self-Hosted Version
+For users who opt for the self-hosted version of Refact, your data stays within your control. When you run a self-hosted server, your data is sent exclusively to your server. This ensures that your code and information remain within your infrastructure, giving you complete control over your data.
+
+### Level 2
+With Level 2 of privacy, Refact has access to files, and data is not protected from sending to third-party models like GPT-3.5
diff --git a/docs/src/content/docs/features/context.md b/docs/src/content/docs/features/context.md
new file mode 100644
index 000000000..bca851521
--- /dev/null
+++ b/docs/src/content/docs/features/context.md
@@ -0,0 +1,53 @@
+---
+title: Context
+description: A reference page about the context.
+---
+
+Context refers to the surrounding information that Refact.ai uses to provide a better quality of generated code. This can include:
+- **Code Syntax**: By analyzing the current state of the code, Refact.ai can provide syntactically correct code completions.
+- **Developer's Intent**: Interpreting comments, variable names, and function signatures, Refact.ai can provide code suggestions that are more relevant to the developer's intent.
+- **Repo-level awareness**: By analyzing the repository's codebase, Refact.ai can provide code suggestions that are more relevant to the existing codebase.
+
+## RAG
+Refact.ai uses RAG (Retrieval-Augmented Generation) to fill the
+context with the information that is needed to provide a better quality of generated code.
+
+### Enabling RAG
+
+In order to enable RAG, you need to follow the instructions depending on the version of the Refact.ai you are using.
+
+### Cloud Version
+
+1. In the settings of the plugin (can be accessed by pressing the cogwheel icon in the sidebar), under the `Refactai: Code Completion Model` section, specify the `starcoder2/3b` model.
+
+2. To enable RAG for **code completion**, you need to enable the `Enable syntax parsing` checkbox under the `Refactai: Ast` section.
+3. To enable RAG for the **AI chat**, you need to enable the `Enable embedded vecdb for search` checkbox under the `Refactai: Vecdb` section. Read more in the [AI Chat Documentation](https://docs.refact.ai/features/ai-chat/) about available features.
+
+
+
+:::note
+RAG is more useful for the context size **more than 2048 tokens**, which is available for **Pro users**.
+
+Be aware that RAG indexing is a **high resource-consuming process**, so you will experience increased memory consumption of your **GPU, RAM, and CPU**.
+:::
+### Refact Enterprise
+
+1. In the Web UI of your Refact.ai instance, navigate to the `Model Hosting` page. press the `Add Model` button to switch the model, locate and select one of the `starcoder2/` models.
+
+:::note
+You can use different models from the `starcoder2` family. But be aware that with Stacoder2 models, the results will be more accurate and the code completion will be more accurate.
+:::
+2. To enable RAG for **code completion**, you need to enable the `Enable syntax parsing` checkbox under the `Refactai: Ast` section.
+3. To enable RAG for the **AI chat**, you need to enable the `Enable embedded vecdb for search` checkbox under the `Refactai: Vecdb` section. Read more in the [AI Chat Documentation](https://docs.refact.ai/features/ai-chat/) about available features.
+
+4. If Vecdb checkbox is enabled in your VS Code settings, you need to select the `thenlper/gte-base` model in your Refact.ai instance.
+In the Web UI of your Refact.ai instance, navigate to the `Model Hosting` page. Press the `Add Model` button, locate and select the `thenlper/gte-base` model.
+
+
+:::note
+Make sure that you have enough memory available on your GPU for the model to be loaded and served.
+
+Altrnitavely you can use unoccupied GPU to avoid the memory issue and interruption of the code generation.
+
+As an aditional option, you can switch from vLLM model to a regular model.
+:::
\ No newline at end of file
diff --git a/docs/src/content/docs/features/finetuning.md b/docs/src/content/docs/features/finetuning.md
new file mode 100644
index 000000000..2e8840a62
--- /dev/null
+++ b/docs/src/content/docs/features/finetuning.md
@@ -0,0 +1,98 @@
+---
+title: Fine-tuning
+description: A reference page about fine-tuning.
+---
+
+Fine-tuning is a process of pretraining a base model to improve the quality of generated code.
+
+Fine-tuning is supported in the following version of Refact.ai:
+- [Self-hosted Refact](https://docs.refact.ai/guides/version-specific/self-hosted/)
+- [Enterprise Refact](https://docs.refact.ai/guides/version-specific/enterprise/getting-started/)
+
+## Use-cases
+
+Fine-tuning can be particularly useful for:
+- Adapting the model to a specific programming language.
+- Customizing the model for a particular technology stack.
+- Aligning the model outputs with a predefined style guide.
+
+## Creating a Fine-Tuned Model
+
+### Create a Project
+1. Navigate to the `Projects` dropdown.
+2. Click the `New Project` button or choose an existing project if applicable.
+3. In the pop-up window, enter the project name and click `Create`.
+
+
+
+### Add Fine-Tuning Data
+You can add data for fine-tuning through the following methods:
+- **Add Git Repository**:
+ - For public repositories, use an HTTPS link: `https://github.com/my_company/my_repo`.
+ - For private repositories, ensure an SSH Key is added, then use an SSH link: `git@github.com:my_company/my_repo.git`.
+ - Optionally, specify the branch to pull data from.
+- **Upload Files**:
+ - **By Link**: Enter the URL of the file (e.g., `https://yourserver.com/file.zip`). Make sure to use a direct URL.
+ - **From Local Storage**: Click `Choose file` and select the file to upload from your local device.
+
+
+
+### Scan and Filter Files
+1. Click `Run 'git pull', scan files`.
+2. After scanning, the file types and counts are displayed in the **File Type Filter** section.
+3. Select the file types you want to fine-tune with checkboxes. Details on accepted and rejected files are available by clicking the **Full List** button.
+:::note
+For rejected files, reasons for rejection are provided next to each file name. To include rejected files, specify directory paths or paths to specific files in the **Include** section.
+:::
+
+
+
+### Start Fine-Tuning
+1. Click `Proceed to Fine-tuning` or navigate to the **Finetune** page.
+2. In the **Start New Finetune** page, select the project created during the previous steps.
+3. Select the model you want to fine-tune from the **Select Model** dropdown.
+
+2. On the fine-tuning page, click `Start Fine-tuning`.
+3. In the pop-up, name your fine-tuning session and select:
+ - **Train embeddings** for large code bases.
+ - **Keep it smaller** for smaller code bases.
+ - **GPUs** - select the number of the GPU to use for fine-tuning (number of the GPU starting from 0). If you have multiple GPUs, you can select more than one GPU.
+ 
+ - Alternatively, manually adjust fine-tuning settings like model capacity or training schedule.
+
+
+
+### Monitor Fine-Tuning
+Once the fine-tuning is started, you can monitor the progress in the **Finetune** page.
+
+On the right side, the following information is displayed:
+- **Chart** - shows the results of the fine-tuning
+- **ETA bar** - shows the estimated time remaining
+- **Information** - provides the following information:
+ - **Logs** - shows the logs of the fine-tuning
+ - **Checkpoints** - lists the checkpoints created during the fine-tuning
+ - **Parameters** - provides information about the parameters used during the fine-tuning
+ - **Files** - provides information about the files used during the fine-tuning
+
+
+
+### Select the Base Model
+Once the fine-tuning is completed, navigate to the **Model Hosting** page and click `Add Model` to choose the base model.
+
+:::note
+Refact.ai offers a variety of base models. Ensure you select the same model used during fine-tuning.
+:::
+
+After selecting the model, select the newly created lora **(the result of fine-tuning, which will act as a patch to the base model)** in the **Finetune** row.
+
+
+
+### Enabling Fine-Tuning for Teams
+
+With **Refact.ai Enterprise**, you can enable different fine-tuning options for different teams.
+
+Navigate to the **Users** page. You will see a list of all users and **Team Preferences** section.
+
+You can specify the completion model. When having multiple projects and fine-tuned models, you can specify the completion model for each project.
+
+
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/authentication/keycloak.md b/docs/src/content/docs/guides/authentication/keycloak.md
new file mode 100644
index 000000000..707ab256f
--- /dev/null
+++ b/docs/src/content/docs/guides/authentication/keycloak.md
@@ -0,0 +1,99 @@
+---
+title: Keycloak Integration Guide
+description: Step-by-step instructions for integrating Keycloak with Refact.ai Enterprise for access management.
+---
+
+Keycloak provides a secure solution for Identity and Access Management (IAM). This
+guide will walk you through the steps to integrate Keycloak with Refact.ai Enterprise.
+
+## Setting Up Keycloak
+
+### Accessing the Keycloak Console
+
+1. Begin by navigating to the Keycloak console in your browser.
+
+### Choosing a Realm
+
+2. **Realm Selection**:
+ - **For a New Realm**: Click `Create Realm`. Provide a name for your new realm and proceed.
+ - **For an Existing Realm**: Select an existing realm from the dropdown menu if applicable.
+ 
+
+### Creating and Configuring the Client
+
+3. Navigate to the `Clients` tab.
+ 
+
+4. Click `Create client` and enter the following details:
+ - **Client ID**: (e.g., `refact_client`)
+ - **Name**: (e.g., `Refact Client`)
+ 
+
+5. Adjust the **Capability config** to:
+ - Enable `Client Authentication`
+ - Set `Authorization` to OFF
+ - For `Authentication Flow`, select only `Direct Access Grants`, `Service Accounts Roles`, and `Standard flow` and deselect other options.
+ 
+
+6. Configure the **Access Settings** as follows:
+ - **Valid Redirect URIs**: The URL of your Refact.ai Enterprise inference. For example, `https://enterprise.inference-server.local/*` (replace `enterprise.inference-server.local` with your Refact.ai Enterprise URL and make sure to include the trailing slash and an asterisk at the end)
+ - **Web Origins**: The URL of your Refact.ai Enterprise inference. For example, `https://enterprise.inference-server.local/`
+ 
+
+7. Leave both `Root URL` and `Home URL` fields empty in the `Login Settings` tab.
+ 
+
+## Adding a Service Role to the Client
+
+1. In your newly created client, add a service role.
+ 
+
+2. Click `Assign role` and modify `Filter by realm roles` to `Filter to clients`. Then, in the search field, input `view-users`.
+ 
+ 
+
+3. Go to the `Credentials` tab, locate, and save the `Client Secret` value.
+ 
+
+### Configuration Summary
+
+Ensure your settings are as follows for successful integration:
+
+```
+client_id = refact_client
+client_secret = ***** (Your generated client secret)
+realm = your_realm_name
+url = https://keycloak.refact.ai/
+```
+
+
+## Integrating Keycloak with Refact.ai Enterprise
+
+
+### Regular User Flow
+
+1. Navigate to your Refact.ai Enterprise instance. Press `Continue to Keycloak`.
+ 
+You will be redirected to the Keycloak, enter your credentials and click `Sign in`.
+
+2. You will be redirected to your Refact.ai Enterprise instance. You will see your user profile information:
+ - Account Login
+ - Plugin API Key
+ - Your team
+
+ 
+
+### Admin User Flow
+
+1. Navigate to your Refact.ai Enterprise instance. Press `Administrator login`.
+ 
+
+2. Fill in your Refact.ai admin token.
+ 
+
+3. Press the `Auth` tab in the `settings` dropdown.
+ 
+
+4. Input the previously configured Keycloak settings. Confirm by clicking `Save Settings`.
+ 
+
diff --git a/docs/src/content/docs/guides/deployment/aws/ec2.md b/docs/src/content/docs/guides/deployment/aws/ec2.md
new file mode 100644
index 000000000..b886f9321
--- /dev/null
+++ b/docs/src/content/docs/guides/deployment/aws/ec2.md
@@ -0,0 +1,47 @@
+---
+title: Deploying Refact.ai on AWS - Launch Through EC2
+description: A page with instructions on how to deploy Refact on AWS.
+---
+
+When deploying Refact.ai through the Amazon EC2 Console, you will see the form with pre-filled values. Only two of these values need to be manually changed.
+
+## Instance Name
+
+The instance name is the name that will be used to identify the instance in the AWS console. This value needs to be entered manually.
+
+
+
+## Application and OS Images (Amazon Machine Image)
+
+AMI (Amazon Machine Image) is the template that is responsible for containing the Refact.ai configurations. The AMI is pre-selected and does not need to be changed.
+
+
+
+## Instance Type
+
+The instance type is pre-selected and does not need to be changed.
+
+:::note
+`g5` family instance types are recommended for production use. Contact Refact.ai team for recommendation on the amount of GPUs suitable for your use case.
+:::
+
+
+
+## Key Pair (Optional)
+
+The key pair is necessary for SSH connections to your EC2 instance.
+To create a key pair press the `Create Key Pair` button.
+
+
+
+## Network Settings
+
+The network settings are pre-selected and do not need to be changed.
+The values should match the onees on the screenshot below.
+
+
+
+After verifying the settings, click on the `Launch Instance` button.
+You will see the following screen, confirming that the instance is being created.
+
+
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/deployment/aws/getting-started.md b/docs/src/content/docs/guides/deployment/aws/getting-started.md
new file mode 100644
index 000000000..8f5fef98e
--- /dev/null
+++ b/docs/src/content/docs/guides/deployment/aws/getting-started.md
@@ -0,0 +1,23 @@
+---
+title: Deploying Refact.ai on AWS - Getting Started
+description: A page with instructions on how to deploy Refact on AWS.
+---
+
+This guide provides step-by-step instructions for deploying Refact.ai on AWS.
+
+Navigate to Refact.ai Marketplace Page to deploy Refact.ai Enterprise on AWS ([NVIDIA](https://aws.amazon.com/marketplace/pp/prodview-oxr7ztqsgs3lk?sr=0-1&ref_=beagle&applicationId=AWSMPContessa) or [Neuron Chip](https://aws.amazon.com/marketplace/pp/prodview-rdudhchequqly?sr=0-2&ref_=beagle&applicationId=AWSMPContessa))
+
+1. On the Refact.ai Marketplace page, press **Continue to Subscribe**.
+
+2. Accept the terms and conditions.
+
+3. Press the **Continue to Configuration** button.
+
+4. Select the **Region** and **Software Version**. Software version refers to the Refact version you want to deploy. By default, the latest version is selected.
+
+
+Press the **Continue to Launch** button. There are two options to proceed with in the drop-down menu. Follow one of the guides to launch Refact:
+- [Launch through EC2](https://docs.refact.ai/guides/deployment/aws/ec2/) - this option is recommended for advanced users.
+- [Launch from Website](https://docs.refact.ai/guides/deployment/aws/marketplace/) - this option is recommended for faster deployment.
+
+
diff --git a/docs/src/content/docs/guides/deployment/aws/marketplace.md b/docs/src/content/docs/guides/deployment/aws/marketplace.md
new file mode 100644
index 000000000..af002ed1f
--- /dev/null
+++ b/docs/src/content/docs/guides/deployment/aws/marketplace.md
@@ -0,0 +1,12 @@
+---
+title: Deploying Refact.ai on AWS - Through AWS Marketplace
+description: A page with instructions on how to deploy Refact on AWS.
+---
+
+When selecting the option to deploy Refact.ai through the Marketplace page, you will be presented with a screen that will have everything pre-configured for you.
+
+
+
+Once you click on the Launch button, you will be presented with a screen that will confirm that your instance is successfully deployed.
+
+
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/deployment/aws/usage.md b/docs/src/content/docs/guides/deployment/aws/usage.md
new file mode 100644
index 000000000..87d75e6b8
--- /dev/null
+++ b/docs/src/content/docs/guides/deployment/aws/usage.md
@@ -0,0 +1,16 @@
+---
+title: Deploying Refact.ai on AWS - Usage
+description: A page with instructions on how to deploy Refact on AWS.
+---
+
+In order to use your Refact.ai instance on AWS, you need to navigate to the AWS Console and locate the newly created instance.
+
+
+
+In the instance summary, locate the `Public IPv4 DNS`. This is the value you will need to use to access your instance.
+
+After navigating to the instance, you will need to create an access token to use with Refact.ai.
+
+
+
+Once you have created the token, you need to activate your Refact.ai license. Navigate to the [License Activation Giude](https://docs.refact.ai/guides/version-specific/enterprise/license/) for more information.
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/deployment/runpod.md b/docs/src/content/docs/guides/deployment/runpod.md
new file mode 100644
index 000000000..0945c20eb
--- /dev/null
+++ b/docs/src/content/docs/guides/deployment/runpod.md
@@ -0,0 +1,77 @@
+---
+title: Deploying Refact.ai on Runpod
+description: A page with instructions on how to deploy Refact on Runpod.
+---
+
+## What is Runpod
+Runpod is a GPU Cloud service designed for AI applications.
+
+It is designed to simplify the deployment process of the application. For more information, visit [runpod.io](https://www.runpod.io/).
+## Using Refact.ai Templates
+Refact distributes templates to simplify the bootstrapping process. There are two templates available:
+- [Refact.ai self-hosted](https://runpod.io/gsc?template=gyscn6cs4i&ref=jlbympsh)
+- [Refact.ai Enterprise](https://runpod.io/gsc?template=ki0zwfnj98&ref=jlbympsh)
+
+Use the links above to create an instance with a template attached to the pod.
+## Selecting a GPU for the Refact.ai Instance
+Once you click the link to the template, you will navigate to the page where you need to specify the GPU you want to use.
+
+
+
+Each GPU is represented as a card with the following information:
+- Drop down with a type of GPU. Here, you can specify the number of GPUs you want to use. By default, one GPU is selected.
+- VRAM for a specific GPU
+- Pricing plan
+
+Once you pick the GPU, press the `Deploy` button to proceed.
+## Deploying the Refact.ai Instance
+In the next step, you will see a card with the settings of your GPU cloud before deploying it with the following information:
+- Selected GPU
+- Pricing plan
+- Template that is used for the deployment
+
+
+
+Once confirmed that everything is specified correctly, press the `Continue` button or `Go back` to select a different type or amount of GPUs.
+
+After pressing the `Continue` button, you will see the summary of the instance you are about to deploy.
+
+
+
+The deployment process will start automatically when pressing the `Deploy` button.
+## Refact.ai Instance Configuration
+Your newly created pod comes fully configured because of the bootstrapping with a Refact.ai template.
+
+
+
+### Pod Settings
+To see the settings of your pod, press the burger icon at the bottom left side of the pod card. Inside the dropdown, press the `Edit pod` button.
+
+
+
+In the modal window, you will see the following information about the instance:
+- Docker image name
+- Container disk
+- Volume disk - can be modified if more space is required
+- Volume mount path - do not modify this field
+- Env variables
+ - Admin token - specify a password you will use to access the Refact.ai interface (for the Refact.ai Enterprise instance)
+ - Can be exteneded with variables that are available with Runpod. The list can be verified in the [Rundpod documentation](https://docs.runpod.io/docs/pod-env-variables).
+### Connecting to Refact.ai Instance
+In the Runpod UI, press the `Connect` button to see different connection options.
+
+
+
+#### Connecting to Web GUI
+By pressing the `Connect to HTTP Service [Port 8008]` button, you will be redirected to a new page where you will see the Refact.ai login page
+#### Runpod Web Terminal
+By pressing the `Start Web Terminal`, you can access your pod through the terminal integrated into the Runpod UI.
+#### Connecting Through Your Local Terminal
+You can access your instance through your local terminal by copying the value under the `Basic SSH Terminal`.
+
+:::caution
+Make sure you added the public SSH key in the pod settings as a value for the `Public key` environmental variable.
+:::
+
+## Network Volume
+In order to save pod settings and stats, Runpod offers a Network Volume. To read more about it, visit [Runpod documentation](https://docs.runpod.io/docs/create-a-network-volume).
diff --git a/docs/src/content/docs/guides/image.png b/docs/src/content/docs/guides/image.png
new file mode 100644
index 000000000..a2931804b
Binary files /dev/null and b/docs/src/content/docs/guides/image.png differ
diff --git a/docs/src/content/docs/guides/plugins/jetbrains/troubleshooting.md b/docs/src/content/docs/guides/plugins/jetbrains/troubleshooting.md
new file mode 100644
index 000000000..a8875c31e
--- /dev/null
+++ b/docs/src/content/docs/guides/plugins/jetbrains/troubleshooting.md
@@ -0,0 +1,42 @@
+---
+title: Troubleshooting
+---
+
+## Fixing the Refact.ai Plugin in JetBrains IDEs without JCEF
+
+### Changing the JBR in JetBrains IDEs to Fix the Markdown Plugin
+
+After installing the Refact.ai plugin in JetBrains IDEs, you may receive a notification indicating that the plugin is not functioning correctly.
+
+
+
+To utilize chat functionality, JCEF - [Java Chromium Embedded Framework](https://plugins.jetbrains.com/docs/intellij/jcef.html) - is required. JCEF is pre-bundled in the JDK (also referred to as JBR - JetBrains Runtime) with IntelliJ IDEA versions starting from 2020.2.
+
+The solution is to bundle the IDE with a JBR that integrates JCEF.
+
+Fortunately, the JBR can be modified, and JetBrains provides the JBRs for download. JetBrains also offers a [guide to change JBR](https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under), although compatibility with all versions of the IDE may vary.
+
+### Choosing the Boot Java Runtime:
+
+1. Open the menu **Help** > **Find Actionβ¦** (`β§ Shift` + `β Cmd` + `A`) and search for βChoose Boot Java Runtime for the IDEβ¦β and execute it.
+2. In the dialog, open the drop-down **Select runtime**.
+ Note: It is advisable to select the same JBR version that was originally set as default in the IDE.
+ 
+3. Either accept the default selection or choose one that includes JCEF in its title. Confirm your choice by clicking OK.
+ 
+4. After downloading and installing, you must apply the changes by selecting **Restart now**.
+ 
+
+You are now ready to enjoy the complete Refact.ai experience.
+
+### Disabling the JCEF Sandbox
+
+It is highly probable that you will encounter the following message after restarting the IDE:
+
+To resolve this issue:
+* Open the menu **Help** > **Find Actionβ¦** (`β§ Shift` + `β Cmd` + `A`) and search for βRegistryβ¦β and execute it.
+* Locate the key `ide.browser.jcef.sandbox.enable` by typing the initial letters or scrolling through the list.
+* Disable this key.
+
+* Close the Registry Editor.
+* Restart the IDE.
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/reverse-proxy.md b/docs/src/content/docs/guides/reverse-proxy.md
new file mode 100644
index 000000000..7f1b4d9ad
--- /dev/null
+++ b/docs/src/content/docs/guides/reverse-proxy.md
@@ -0,0 +1,129 @@
+---
+title: Self-hosted Refact
+description: Setting Up nginx Reverse Proxy for Refact
+---
+
+## Why Reverse Proxy?
+
+To access a Refact server from anywhere on the internet, the reverse proxy needs to accept encrypted HTTPS requests and forward them via HTTP to the Refact server.
+
+Transport encryption is not the only thing you need to make the connection secure -- you also need to set a good password.
+
+
+## Self-Signed Certificate
+
+You can generate a self-signed certificate in one command:
+
+```bash
+openssl req -x509 -newkey rsa:4096 -nodes -keyout private_key.key -out certificate.crt -days 365
+```
+
+Of course it's better to use a real certificate, because clients will be able to verify it, making
+man-in-the-middle attacks impossible.
+For a self-signed certificate, you will need to set "Allow insecure server connections when using SSL" option
+in the IDE plugin settings.
+
+
+## Setting Up
+
+The next command assumes you have nginx installed on your server.
+It's possible to try it your laptop as well (use `brew install nginx` on a macbook).
+
+```bash
+/opt/homebrew/opt/nginx/bin/nginx -g "daemon off;" -c ~/my_reverse_proxy.config
+```
+
+The `daemon off;` part allows nginx to run the the current console, so you can quickly stop and restart it.
+
+An example of `my_reverse_proxy.config` that's tested to work with Refact, with comments:
+
+```
+http {
+ upstream refact-default {
+ zone refact-default 1m;
+ server 127.0.0.1:8008; # replace with your address
+ keepalive 2;
+ }
+
+ server {
+ listen 0.0.0.0:443 ssl http2;
+ server_name myserver;
+
+ ssl_certificate /your/path/certificate.crt;
+ ssl_certificate_key /your/path/private_key.key;
+
+ add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
+ add_header X-Frame-Options SAMEORIGIN always;
+ add_header X-Content-Type-Options nosniff always;
+ add_header X-XSS-Protection "1; mode=block" always;
+ add_header Referrer-Policy "no-referrer" always;
+ add_header X-Permitted-Cross-Domain-Policies "none" always;
+ add_header X-Robots-Tag "noindex, nofollow" always;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $http_connection;
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_buffering off; # makes chat streaming possible
+
+ location / {
+ allow all;
+ proxy_pass http://refact-default; # here "refact-default" refers to the upstream block above
+ }
+
+ error_page 307 = @redirect;
+ location @redirect {
+ return 307 https://$host$request_uri;
+ }
+
+ client_max_body_size 1G;
+
+ ssl_protocols TLSv1.2 TLSv1.3; # The refact-lsp binary does not support TLSv1.3 yet -- waiting for reqwest library to catch up
+ ssl_prefer_server_ciphers on;
+ ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
+ ssl_ecdh_curve secp384r1;
+ ssl_session_timeout 10m;
+ ssl_session_cache shared:SSL:10m;
+ ssl_session_tickets off;
+ ssl_stapling on;
+ ssl_stapling_verify on;
+ resolver_timeout 5s;
+ }
+}
+
+events {
+ worker_connections 1024;
+ multi_accept on;
+}
+```
+
+## Debugging
+
+Refact plugins use `refact-lsp` to communicate with the server. It starts together with the IDE as a subprocess. Here is a command to find it when it's running:
+
+```
+ps aux | grep refact-lsp
+```
+
+You can quickly run `refact-lsp` in the terminal to see if your proxy works. If it doesn't, you'll see the error immediately:
+
+```
+PATH_TO_BINARY/refact-lsp --address-url https://127.0.0.1:443/ --api-key XXX --http-port 8001 --logs-stderr
+```
+
+where PATH_TO_BINARY you can copy-paste from the previous command. The line you are looking for is:
+
+```
+2023-12-01T19:42:54.208374Z INFO refact_lsp::caps:264: reading caps from https://127.0.0.1:443/coding_assistant_caps.json
+```
+
+If that works, and it really has "https" in the address, then the proxy is working correctly!
+
+If it doesn't, you can look at the error message, and also you can try to fetch the same file using curl:
+
+```bash
+curl https://127.0.0.1:443/coding_assistant_caps.json
+```
+
+And compare the results. Please report any problems following this page!
diff --git a/docs/src/content/docs/guides/version-specific/enterprise/getting-started.md b/docs/src/content/docs/guides/version-specific/enterprise/getting-started.md
new file mode 100644
index 000000000..69593630e
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/enterprise/getting-started.md
@@ -0,0 +1,51 @@
+---
+title: Enterprise Refact Edition - Getting Started
+description: What Enterprise Refact is and how it works.
+---
+
+Enterprise self-hosted version of Refact allows you to deploy various code models for a local AI code assistant inside your IDE. It also allows you to create a fine-tuned model on your company's codebase.
+The enterprise plan is designed for teams who want to have full control over their Refact experience and access to all features.
+
+## Prerequisites
+
+:::note
+This and the following step are required to deploy the Refact server in a local environment. If you are using services like AWS or Runpod, read one of the following guides:
+- [Runpod Guide](https://docs.refact.ai/guides/deployment/runpod/)
+- [AWS Guide](https://docs.refact.ai/guides/deployment/aws/getting-started)
+:::
+
+- Docker with GPU support. Follow the link to [install Docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). On Windows you need to install WSL 2 first. Follow the guide to [install WSL 2](https://docs.docker.com/desktop/install/windows-install).
+
+## Pull Docker Image
+
+Run the following in your terminal:
+```
+docker pull smallcloud/refact_self_hosting_enterprise:latest
+wget https://docs.refact.ai/docker-compose.yml
+```
+:::note
+If you have used the enterprise with a `beta` tag before, please ensure you use the `latest` tag from now.
+:::
+[Download](https://docs.refact.ai/docker-compose.yml) the `docker-compose.yml` file and run the docker `compose up` command in your terminal.
+
+## Generating a Random Admin Password (Optional)
+
+The Refact server is designed to be safe to expose to the internet. To do it correctly, make sure you don't skip these two steps:
+1. Generate a random password using the `openssl` utility:
+ ```
+ openssl rand -base64 15
+ ```
+
+ Add the result to `docker-compose.yml` file, the `ENTERPRISE_ADMIN_TOKEN` section.
+
+2. Set up a Reverse Proxy that will handle incoming HTTPS requests and forward them to your Refact server running on HTTP (port 8008). The specific setup depends on what your organization uses.
+
+Refact IDE plugins can connect to the Refact server using either HTTP or HTTPS protocols.
+
+The unencrypted HTTP is fine when using a local network or VPN. But the plugins will require a valid SSL/TLS certificate for HTTPS connection. Ask the administrator in your company about setting up a reverse proxy and obtaining a valid certificate.
+
+Server Web UI requires an admin password to log in. If you forgot the password, you can delete the container and run it again. The `docker-compose.yml` defines persistent volumes to store all the important data, they will survive container restart, kill/run cycle or upgrade.
+
+## User Management
+
+To find out how to manage users, refer to the [User Creation](https://docs.refact.ai/guides/version-specific/enterprise/users/#create-a-user) section.
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/version-specific/enterprise/license.md b/docs/src/content/docs/guides/version-specific/enterprise/license.md
new file mode 100644
index 000000000..016d5858a
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/enterprise/license.md
@@ -0,0 +1,17 @@
+---
+title: Enterprise Refact Edition - Activating the License
+description: How to set up plugins for Enterprise Refact Edition
+---
+
+## Enter your license key
+Navigate to the **License** page through the **Settings** drown menu in the top right corner and input your license key.
+
+
+
+## Check Activation
+After activation, you will see the **number of users** and the **expiration date** for your license.
+
+
+
+## Need an Enterprise License?
+If you don't have an enterprise license key, please [contact](https://refact.ai/contact/) the Refact team to get one.
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/version-specific/enterprise/model-hosting.md b/docs/src/content/docs/guides/version-specific/enterprise/model-hosting.md
new file mode 100644
index 000000000..15995878d
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/enterprise/model-hosting.md
@@ -0,0 +1,16 @@
+---
+title: Enterprise Refact Edition - Model Hosting
+description: What Enterprise Refact is and how it works.
+---
+
+Refact Enterprise Refact is a version that is optimized for enterprise use cases. It allows you to use all of the models available in Refact.ai Self-hosted and also supports vLLM models.
+
+### Enabling vLLM
+
+With the enterprise version of Refact, you can use an inference engine that uses `PagedAttention` from the vLLM library. It works faster and supports continuous batching, which means it can start work on new inference tasks, while continuing to serve other clients at the same time.
+
+To enable vLLM select one the available vLLM models in the **Model Hosting** page. The full list of available models can be found on the [Supported Models page](https://docs.refact.ai/supported-models/).
+
+:::note
+vLLM models are suitable for a fast inference. The limitation with the vLLM models is that they **don't support sharding**.
+:::
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/version-specific/enterprise/plugins.md b/docs/src/content/docs/guides/version-specific/enterprise/plugins.md
new file mode 100644
index 000000000..716c234b4
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/enterprise/plugins.md
@@ -0,0 +1,9 @@
+---
+title: Enterprise Refact Edition - Setting Up Plugins
+description: How to set up plugins for Enterprise Refact Edition
+---
+
+- **VS Code**: go to **Settings** and specify the **server address** and **Refact API key** provided by your admin.
+- **JetBrains**: go to **Settings** and specify the **server address** and the **Refact API key** provided by your admin.
+
+Once you connect the API key, start writing code, and code suggestions from a selected model will appear automatically.
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/version-specific/enterprise/users.md b/docs/src/content/docs/guides/version-specific/enterprise/users.md
new file mode 100644
index 000000000..aaebe1a0e
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/enterprise/users.md
@@ -0,0 +1,44 @@
+---
+title: Enterprise Refact Edition - Users
+description: What Enterprise Refact is and how it works.
+---
+
+Refact.ai enterprise edition allows you to create and manage users. You are able to create users, assign them to teams, and manage their access to the platform.
+
+The amount of users you can create is configured in the license. If you are not sure what is the amount of users associated with your license, please [contact the Refact team](https://refact.ai/contact/).
+
+## Create a user
+
+1. Navigate to the **Users** tab.
+2. Click the **Add user** button.
+3. Enter the **user's name** and the **team** to which the user will be assigned.
+
+5. Click the **Save** button.
+
+:::note
+You can change the **team** to which the user will be assigned after creating the user. Press the **Edit** button associated with the user and type the new team name and click the **Save** button.
+:::
+
+## Retrevieng the API key of a user
+
+For admins, you can retrieve the API key of a user to share with users to complete the authorization process. To retrieve the API key of a user:
+
+1. Navigate to the **Users** tab.
+2. Click the **Edit** button associated with the user.
+3. Copy the API key. That value will be used to complete the authorization process in the IDE.
+
+
+## Advanced Authentication
+
+For advanced authentication, refer to the [Keycloak Integration guide](https://docs.refact.ai/guides/authentication/keycloak/).
+
+## Assigning models and LoRAs to users
+
+You can different models and LoRAs to teams. To assign models and LoRAs use the following guide:
+
+1. Navigate to the **Users** tab.
+2. On the right side of the page locate the **Team Preferences** section.
+
+By default, the base model that is configured on **Model Hosting** page is assigned to all teams. To assign a LoRA to a team, click the name of the model under the **Default Completion Model** section. In the dropdown menu, select the LoRA that you want to assign to the specific team.
+
+
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/version-specific/self-hosted.md b/docs/src/content/docs/guides/version-specific/self-hosted.md
new file mode 100644
index 000000000..9847e76aa
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/self-hosted.md
@@ -0,0 +1,67 @@
+---
+title: Self-hosted Refact
+description: A page with instructions on how to run a self-hosted Refact option.
+---
+
+Self-hosted version of Refact is a more flexible option with additional features. It allows you to create fine-tuned models for your specific task.
+
+Self-hosted version is designed for developers who want to have a full control over their Refact experience.
+
+## Prerequisites
+- Docker with GPU support
+
+## Installation
+
+The easiest way to run this server is a pre-build Docker image.
+
+Install [Docker with NVidia GPU support](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). On Windows you need to install WSL 2 first, [one guide to do this](https://docs.docker.com/desktop/install/windows-install).
+
+Run docker container with following command:
+
+```bash
+docker run -d --rm -p 8008:8008 -v perm-storage:/perm_storage --gpus all smallcloud/refact_self_hosting
+```
+:::note
+`perm-storage` is a volume that is mounted inside the container. All the configuration files, downloaded weights and logs are stored here.
+:::
+
+To upgrade the docker, delete it using `docker kill XXX` (the volume `perm-storage` will retain your data), run `docker pull smallcloud/refact_self_hosting` and run it again.
+
+Now you can visit http://127.0.0.1:8008 to see the server Web GUI.
+
+
+
+:::note
+Add yourself to docker group to run docker without sudo (works for Linux): `commandline sudo usermod -aG docker {your user}`
+List all containers: `commandline docker ps -a`
+Start and stop existing containers (stop doesn't remove them): `commandline docker start XXX docker stop XXX`
+Shows messages from a container: `commandline docker logs -f XXX`
+Remove a container and all its data (except data inside a volume): `commandline docker rm XXX`
+Check out or delete a docker volume: `commandline docker volume inspect VVV docker volume rm VVV`
+:::
+
+### Sharding
+
+You can choose to deploy a model to several GPUs with sharding. Select the number of GPUs that you would like to run your model on by selecting 1,2 or 4 in the sharding menu.
+
+### Shared GPU
+
+To run several smaller models on one GPU, select the "share GPU" option from the menu next to the selected model.
+
+### Connecting OpenAI API
+
+If you have an OpenAI API key, you can connect it to Refact and use GPT-series models inside Refact.
+
+:::note
+With this integration you will send your data to 3rd party providers (OpenAI). To enable OpenAI integration, you should go to settings (top right) and set and save your API key for the server usage.
+:::
+
+## Custom Inference setup
+
+Go to plugin settings and set up a custom inference URL http://127.0.0.1:8008
+
+### JetBrains
+Settings > Tools > Refact.ai > Advanced > Inference URL
+
+### VSCode
+Extensions > Refact.ai Assistant > Extension Settings > Infurl
\ No newline at end of file
diff --git a/docs/src/content/docs/guides/version-specific/teams.md b/docs/src/content/docs/guides/version-specific/teams.md
new file mode 100644
index 000000000..d9d4e87be
--- /dev/null
+++ b/docs/src/content/docs/guides/version-specific/teams.md
@@ -0,0 +1,62 @@
+---
+title: Refact teams
+description: Refact teams
+---
+
+## Overview
+Refact Teams enables your team to use an AI coding assistant powered by cloud inference without the need for a dedicated GPU.
+
+## Creating a Team Account
+
+To get started with Refact Teams, you'll need to create a team account. You can initiate this process by:
+- Emailing us at: ilya@smallcloud.tech
+- Messaging us on [Discord](https://smallcloud.ai/discord).
+
+Upon contact, we will provide you a workspace link and password.
+
+## How to Use Refact Teams
+
+After setting up your team account, you can log in to access your workspace. The workspace is divided into two main sections:
+- **Stats Dashboard**
+- **Access Control**
+
+The Stats dashboard offers comprehensive metrics to see the impact of Refact. It includes:
+- **Completions Daily**: Track daily completions.
+- **Refact vs Human Weekly**: Compare weekly coding contributions between Refact.ai coding assistant and team members.
+- **Refact's Impact by Programming Language**: Understand how Refact assists across different languages.
+- **Users Daily**: Monitor daily active users.
+
+
+
+For detailed user-specific metrics, visit the Users tab within the Stats section.
+
+
+
+## Access Control
+
+Manage your team members' access through the Access Control page. Here, you can:
+
+- **Add New Users**: Integrate new team members by specifying their account details and assigning them to a team.
+- **Edit Existing Users**: Update user information as needed.
+
+
+
+Each user has specific settings:
+- **Account**: The email address associated with the user.
+- **Team**: The specific team the user is part of.
+- **API Key**: A unique key required for plugin authentication.
+
+
+
+## Plugin Configuration
+
+For using Refact Teams with your IDE, follow these instructions to set up the plugin when logging in:
+
+1. **Select Refact Enterprise**: Choose `Refact Enterprise` within the plugin login options.
+2. **Configuration Settings**:
+ - **Inference URL**: Enter the URL provided for your team's workspace.
+ - **API Key**: Input the API Key associated with your user from the Access Control page. Each team member will use their unique API Key for authentication.
+
+
+
+After applying these settings, the plugin will be configured to work with Refact Teams.
\ No newline at end of file
diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx
new file mode 100644
index 000000000..05068eca0
--- /dev/null
+++ b/docs/src/content/docs/index.mdx
@@ -0,0 +1,43 @@
+---
+title: Refact Documentation
+description: Refact is an open-source AI coding assistant for VS Code and JetBrains.
+next:
+ link: /introduction/quickstart/
+ label: Quickstart
+---
+
+Refact is an open-source AI coding assistant for VS Code and JetBrains.
+
+It allows you to use various open-source (like **Code Llama**) and closed-source (like **GPT-4**) Large Language Models (**LLMs**) for code completion, code refactoring and chat.
+
+Self-hosted Refact allows you to personalize code LLMs for code completion with an intuitive Web UI.
+
+## Guides
+To get started, follow the guides:
+- [QuickStart](https://docs.refact.ai/introduction/quickstart/)
+- [Self-hosted Refact](https://docs.refact.ai/guides/version-specific/self-hosted/)
+- [Enterprise Refact Edition](https://docs.refact.ai/guides/version-specific/enterprise/getting-started/)
+
+## Privacy
+Refact allows you to restrict access to particular files or projects, ensuring that your private code or confidential files are protected.
+
+We never store your code on the server side.
+
+Read more about privacy settings in the [Privacy Documentation](https://docs.refact.ai/features/code-completion/#privacy).
+
+
+import { Card, CardGrid } from '@astrojs/starlight/components';
+
+## More Resources
+
+
+
+ To get assistance from the Refact community and team members, join the [Discord server](https://smallcloud.ai/discord).
+
+
+ [FAQ segment](https://docs.refact.ai/faq/) covers the most popular questions about Refact.
+
+
+ To set up Refact for development, follow the [Contributing Guide](https://docs.refact.ai/contributing/) and check the available issues on [GitHub](https://github.com/smallcloudai/refact).
+
+
diff --git a/docs/src/content/docs/installation/installation-hub.mdx b/docs/src/content/docs/installation/installation-hub.mdx
new file mode 100644
index 000000000..898d7e116
--- /dev/null
+++ b/docs/src/content/docs/installation/installation-hub.mdx
@@ -0,0 +1,23 @@
+---
+title: Installation Hub
+description: Homepage for the Refact.ai installation guide
+---
+
+import { Card, CardGrid } from '@astrojs/starlight/components';
+
+Refact.ai is available for the following IDEs.
+
+Each card consists of two links:
+- Marketplace download link
+- Detailed installation guide
+
+
+
+ [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/20647-codify)
+ [JetBrains Installation Guide](https://docs.refact.ai/installation/jetbrains/)
+
+
+ [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=smallcloud.codify)
+ [VS Code Guide](https://docs.refact.ai/installation/vs-code/)
+
+
\ No newline at end of file
diff --git a/docs/src/content/docs/installation/jetbrains.md b/docs/src/content/docs/installation/jetbrains.md
new file mode 100644
index 000000000..098c580c1
--- /dev/null
+++ b/docs/src/content/docs/installation/jetbrains.md
@@ -0,0 +1,38 @@
+---
+title: Refact for JetBrains IDEs
+description: A page which explains how to install and use Refact for JetBrains IDEs
+---
+
+For JetBrains products, after installing the plugin from the [marketplace](https://plugins.jetbrains.com/plugin/20647-codify), press the Refact logo to open the UI of the plugin.
+
+Pick one of the available versions and click the **Next** button.
+
+
+
+The quickest way to get started is with **Cloud** option. When pressing the **Next** button, you will see an interface similar to the one below:
+
+
+
+When pressing the **Login** or **Create Account** button, you will be redirected to the Refact's login page in your browser.
+
+After completing the login process, the interface of the sidebar will change to the following:
+
+
+
+For the Self-hosted and Enterprise options, follow one of the following guides:
+
+- [Self-hosted Login](https://docs.refact.ai/guides/version-specific/self-hosted/#custom-inference-setup)
+- [Enterprise Login](https://docs.refact.ai/guides/version-specific/enterprise/getting-started/#setting-up-the-plugins)
+
+
+# Early Access Program
+
+If you feel adventurous, add Early Access Program to your Plugins settings over here:
+
+
+
+In a small window called "Custom Plugin Repositories" add "https://plugins.jetbrains.com/plugins/eap/list",
+then update the plugin.
+
+You will have access to the EAP version of the Refact plugin. Not guaranteed to work, but we try not to publish completely
+dysfunctional versions in EAP either. Try new features, report how they work in discord!
diff --git a/docs/src/content/docs/installation/vs-code.md b/docs/src/content/docs/installation/vs-code.md
new file mode 100644
index 000000000..8b0cbca69
--- /dev/null
+++ b/docs/src/content/docs/installation/vs-code.md
@@ -0,0 +1,25 @@
+---
+title: Refact for VS Code
+description: A page which explains how to install and use Refact for VS Code
+---
+
+After installing the plugin from the [marketplace](https://marketplace.visualstudio.com/items?itemName=smallcloud.codify), press the Refact logo to open the UI of the plugin.
+
+Pick one of the available versions and click the **Next** button.
+
+
+
+The quickest way to get started is with **Cloud** option. When pressing the **Next** button, you will see an interface similar to the one below:
+
+
+
+When pressing the **Login** or **Create Account** button, you will be redirected to the Refact's login page in your browser.
+
+After completing the login process, the interface of the sidebar will change to the following:
+
+
+
+For the Self-hosted and Enterprise options, follow one of the following guides:
+
+- [Self-hosted Login](https://docs.refact.ai/guides/version-specific/self-hosted/#custom-inference-setup)
+- [Enterprise Login](https://docs.refact.ai/guides/version-specific/enterprise/getting-started/#setting-up-the-plugins)
\ No newline at end of file
diff --git a/docs/src/content/docs/introduction/quickstart.md b/docs/src/content/docs/introduction/quickstart.md
new file mode 100644
index 000000000..01516cb72
--- /dev/null
+++ b/docs/src/content/docs/introduction/quickstart.md
@@ -0,0 +1,33 @@
+---
+title: Quickstart
+description: Learn how to get started with Refact
+---
+
+## Available Versions
+
+Refact is available in several versions designed for different needs:
+
+- **Cloud Version**: For individual developers who prefer not to manage infrastructure. Just sign up, install, and start using. Navigate to the [Installation Hub](https://docs.refact.ai/installation/installation-hub/) to get started.
+- **Cloud for Teams**: Offers team-specific features for the **Cloud Version**:
+ - Stats Dashboard
+ - Access Control
+
+ Read more in the [Refact.ai Teams Guide](https://docs.refact.ai/guides/version-specific/teams/)
+- **Self-Hosted Version**: For individual developers that need to keep their data localized for security or privacy reasons. Additionally, following features are available:
+ - using your own GPU
+ - fine-tuning LLMs
+
+ Read more in the [Self-hosted Guide](https://docs.refact.ai/guides/version-specific/self-hosted/)
+- **Enterprise**: For large organizations needing advanced security, compliance, and scalability options. Includes premium support and customization. Read more in the [Refact.ai Enterprise Guide](https://docs.refact.ai/guides/version-specific/enterprise/getting-started/)
+
+## Key Features
+
+### Code Completion
+Get accurate code suggestions as you type, tailored to both the syntax and context of your project. Read more in the [Code Completion Section](https://docs.refact.ai/features/code-completion/).
+
+### AI Chat
+Use AI Chat within your IDE to get coding assistance, explanations, and documentation lookup without leaving your coding environment.
+
+### AI Toolbox
+Access a suite of pre-built AI commands, such as `/gen` and `/naming`. You can find the full list of available commands and customization options in the [AI Toolbox Section](https://docs.refact.ai/features/ai-toolbox/)
+
diff --git a/docs/src/content/docs/privacy.md b/docs/src/content/docs/privacy.md
new file mode 100644
index 000000000..9052c9c8d
--- /dev/null
+++ b/docs/src/content/docs/privacy.md
@@ -0,0 +1,31 @@
+---
+title: Privacy
+description: A reference page about privacy levels in Refact.
+---
+
+Privacy settings allow you to control the level of confidentiality to ensure the confidentiality of your code.
+
+There are three levels of privacy you can choose from in Refact.
+Levels of privacy can be modified in the plugin dashboard.
+## Level 0
+With this level of privacy, Refact will not have access to files and data won't be sent to a third-party model.
+
+> With this level of privacy you won't be able to use any of the Refact commands like `Explain code` or `Completion`
+
+## Level 1
+With Level 1 of privacy, Refact has access to your files but data is protected from sending to a third-party model.
+
+At Refact, your privacy and control over your data are fundamental principles that guide our approach. We are committed to providing a secure and reliable environment for all our users, whether you choose to utilize our cloud services or set up a self-hosted server. Your trust is important to us, and we're here to support your coding journey while safeguarding your data every step of the way.
+
+When working with code blocks that use third-party APIs you will receive an error that indicates you need to switch to a Level 2 privacy in order to get a precise analysis of the code.
+
+If you open the tab of the `Explain Code` tab, you will see an error message at the top section
+
+### Refact Cloud Version
+When using Refact's cloud version, data is sent to our servers for processing. However, it's important to note that we do not collect datasets on the server side. Your code and information are used solely to enhance your coding experience and provide you with intelligent suggestions.
+
+### Refact Self-Hosted Version
+For users who opt for the self-hosted version of Refact, your data stays within your control. When you run a self-hosted server, your data is sent exclusively to your server. This ensures that your code and information remain within your infrastructure, giving you complete control over your data.
+
+## Level 2
+With Level 2 of privacy, Refact has access to files, and data is not protected from sending to third-party models like GPT-3.5
diff --git a/docs/src/content/docs/supported-models.md b/docs/src/content/docs/supported-models.md
new file mode 100644
index 000000000..32fe3571e
--- /dev/null
+++ b/docs/src/content/docs/supported-models.md
@@ -0,0 +1,194 @@
+---
+title: Supported Models in Refact
+description: Supported Models in Refact
+---
+
+## Cloud Version of Refact
+
+### Completion models
+- Refact/1.6B
+- starcoder2/3b
+
+### Chat models
+- GPT 3.5
+- GPT 4 (Pro plan)
+
+## Self-Hosted Version of Refact
+
+In Refact self-hosted you can select between the following models:
+
+### Completion models
+
+
+
+
Model Name
+
Fine-tuning support
+
+
+
+
+
Refact/1.6B
+
β
+
+
+
Refact/1.6B/vllm
+
β
+
+
+
starcoder/1b/base
+
β
+
+
+
starcoder/1b/vllm
+
+
+
+
starcoder/3b/base
+
β
+
+
+
starcoder/3b/vllm
+
+
+
+
starcoder/7b/base
+
β
+
+
+
starcoder/7b/vllm
+
+
+
+
starcoder/15b/base
+
+
+
+
starcoder/15b/plus
+
+
+
+
starcoder2/3b/base
+
β
+
+
+
starcoder2/3b/vllm
+
β
+
+
+
starcoder2/7b/base
+
β
+
+
+
starcoder2/7b/vllm
+
β
+
+
+
starcoder2/15b/base
+
β
+
+
+
deepseek-coder/1.3b/base
+
β
+
+
+
deepseek-coder/1.3b/vllm
+
β
+
+
+
deepseek-coder/5.7b/mqa-base
+
β
+
+
+
deepseek-coder/5.7b/vllm
+
β
+
+
+
codellama/7b
+
β
+
+
+
stable/3b/code
+
+
+
+
wizardcoder/15b
+
+
+
+
+
+### Chat models
+
+
+
+
Model Name
+
+
+
+
+
starchat/15b/beta
+
+
+
deepseek-coder/33b/instruct
+
+
+
deepseek-coder/6.7b/instruct
+
+
+
deepseek-coder/6.7b/instruct-finetune
+
+
+
deepseek-coder/6.7b/instruct-finetune/vllm
+
+
+
wizardlm/7b
+
+
+
wizardlm/13b
+
+
+
wizardlm/30b
+
+
+
llama2/7b
+
+
+
llama2/13b
+
+
+
magicoder/6.7b
+
+
+
mistral/7b/instruct-v0.1
+
+
+
mixtral/8x7b/instruct-v0.1
+
+
+
llama3/8b/instruct
+
+
+
llama3/8b/instruct/vllm
+
+
+
+
+For an up-to-date list of models, see the [Known Models file on GitHub](https://github.com/smallcloudai/refact-lsp/blob/main/src/known_models.rs).
+
+## Integrations
+
+Refact.ai offers **OpenAI** and **Anthropic API** integrations.
+
+To enable these integrations, navigate to the **Model Hosting** page activate the **OpenAI** and/or **Anthropic** integrations by pressing the switch button in the **3rd Party APIs** section.
+
+
+
+Press **API Keys tab** link, you will be redirected to the integrations page. Alternatively, you can access the integrations page by clicking on the **Settings** dropdown menu in the header and selecting **Credentials**.
+
+
+
+In the **Credentials** page, you can specify your **OpenAI** and/or **Anthropic** API keys.
+
+:::note
+Make sure the switch button is enabled for each API you want to use. Even if you specify the API key, it will not be used until the switch button is enabled.
+:::
\ No newline at end of file
diff --git a/docs/src/content/docs/supported-models/code-llama.md b/docs/src/content/docs/supported-models/code-llama.md
new file mode 100644
index 000000000..dff633040
--- /dev/null
+++ b/docs/src/content/docs/supported-models/code-llama.md
@@ -0,0 +1,4 @@
+---
+title: Code Llama
+description: A page about Code Llama model.
+---
diff --git a/docs/src/content/docs/supported-models/llama2.md b/docs/src/content/docs/supported-models/llama2.md
new file mode 100644
index 000000000..6e654e6e7
--- /dev/null
+++ b/docs/src/content/docs/supported-models/llama2.md
@@ -0,0 +1,4 @@
+---
+title: Llama2
+description: A page about Llama2 model.
+---
diff --git a/docs/src/content/docs/supported-models/refact-llm.md b/docs/src/content/docs/supported-models/refact-llm.md
new file mode 100644
index 000000000..8a7b18464
--- /dev/null
+++ b/docs/src/content/docs/supported-models/refact-llm.md
@@ -0,0 +1,4 @@
+---
+title: Refact Llm
+description: A page about Refact LLM model.
+---
diff --git a/docs/src/content/docs/supported-models/starcoder.md b/docs/src/content/docs/supported-models/starcoder.md
new file mode 100644
index 000000000..7152916dd
--- /dev/null
+++ b/docs/src/content/docs/supported-models/starcoder.md
@@ -0,0 +1,4 @@
+---
+title: Starcoder
+description: A page about Starcoder model.
+---
diff --git a/docs/src/content/docs/supported-models/wizard-coder.md b/docs/src/content/docs/supported-models/wizard-coder.md
new file mode 100644
index 000000000..cbe6a0136
--- /dev/null
+++ b/docs/src/content/docs/supported-models/wizard-coder.md
@@ -0,0 +1,4 @@
+---
+title: Wizard Coder
+description: A page about Wizard Coder model.
+---
diff --git a/docs/src/env.d.ts b/docs/src/env.d.ts
new file mode 100644
index 000000000..acef35f17
--- /dev/null
+++ b/docs/src/env.d.ts
@@ -0,0 +1,2 @@
+///
+///
diff --git a/docs/src/styles/custom.css b/docs/src/styles/custom.css
new file mode 100644
index 000000000..45c2d6d80
--- /dev/null
+++ b/docs/src/styles/custom.css
@@ -0,0 +1,203 @@
+@import url('https://fonts.googleapis.com/css2?family=Azeret+Mono:ital,wght@0,100..900;1,100..900&family=Manrope:wght@200..800&display=swap');
+/* Dark mode colors. */
+:root {
+ --sl-color-accent-low: #311514;
+ --sl-color-accent: #E7150D;
+ --sl-color-accent-high: #FEF4F4;
+ --sl-color-white: #ffffff;
+ --sl-color-gray-1: #FAFAFA;
+ --sl-color-gray-2: #F3F3F3;
+ --sl-color-gray-3: #D8D8D9;
+ --sl-color-gray-4: #585858;
+ --sl-color-gray-5: #383838;
+ --sl-color-gray-6: #272727;
+ --sl-color-black: #181818;
+
+ /* Sidebar specific colors */
+ --sl-sidebar-color-text-active: var(--sl-color-white);
+ --sl-sidebar-color-bg-active: var(--sl-color-accent);
+ --sl-sidebar-color-bg-hover: var(--sl-color-gray-6);
+}
+
+/* Light mode colors. */
+:root[data-theme='light'] {
+ --sl-color-accent-low: #311514;
+ --sl-color-accent: #E7150D;
+ --sl-color-accent-high: #FEF4F4;
+ --sl-color-white: #181818;
+ --sl-color-gray-1: #272727;
+ --sl-color-gray-2: #383838;
+ --sl-color-gray-3: #585858;
+ --sl-color-gray-4: #8b8b8b;
+ --sl-color-gray-5: #c2c2c2;
+ --sl-color-gray-6: #eeeeee;
+ --sl-color-gray-7: #f6f6f6;
+ --sl-color-black: #ffffff;
+
+ /* Sidebar specific colors */
+ --sl-sidebar-color-text-active: var(--sl-color-white);
+ --sl-sidebar-color-bg-active: var(--sl-color-accent);
+ --sl-sidebar-color-bg-hover: var(--sl-color-gray-6);
+}
+
+/* Main content layout */
+main {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 0 2rem;
+}
+
+/* Search container */
+.search-container {
+ display: flex;
+ justify-content: center;
+ width: 100%;
+ padding: 1rem 0;
+}
+
+/* Rounded corners for various elements */
+a,
+.icon,
+button,
+input,
+.sidebar-content a,
+.pagefind-ui__search-input,
+.search-item,
+.current-page {
+ border-radius: 6px !important;
+ transition: all 0.2s ease;
+}
+
+/* Main sidebar items - first level */
+.sidebar-content > .sidebar-groups > li > details > summary,
+.sidebar-content > .sidebar-groups > li > a {
+ font-size: 1.1rem;
+ font-weight: 600;
+}
+
+/* Second level items - ensure all items at this level match */
+.sidebar-content > .sidebar-groups > li > details li > a,
+.sidebar-content > .sidebar-groups > li > details li > details > summary {
+ font-size: 0.95rem;
+ font-weight: 500;
+}
+
+/* Third level and deeper items */
+.sidebar-content > .sidebar-groups > li > details li > details li > a,
+.sidebar-content > .sidebar-groups > li > details li > details li > details > summary {
+ font-size: 0.9rem;
+ font-weight: 400;
+ padding-left: 0.5rem;
+ color: var(--sl-color-gray-3);
+}
+
+/* Light mode colors. */
+:root[data-theme='light'] {
+ --sl-color-accent-low: #311514;
+ --sl-color-accent: #E7150D;
+ --sl-color-accent-high: #FEF4F4;
+ --sl-color-white: #181818;
+ --sl-color-gray-1: #272727;
+ --sl-color-gray-2: #383838;
+ --sl-color-gray-3: #585858;
+ --sl-color-gray-4: #8b8b8b;
+ --sl-color-gray-5: #c2c2c2;
+ --sl-color-gray-6: #eeeeee;
+ --sl-color-gray-7: #f6f6f6;
+ --sl-color-black: #ffffff;
+
+ /* Sidebar specific colors */
+ --sl-sidebar-color-text-active: var(--sl-color-white);
+ --sl-sidebar-color-bg-active: var(--sl-color-accent);
+ --sl-sidebar-color-bg-hover: var(--sl-color-gray-6);
+}
+
+body {
+ font-family: "Manrope", sans-serif;
+ font-optical-sizing: auto;
+ font-size: 16px;
+}
+
+/* theme overrides */
+kbd {
+ font-size: 10px !important;
+ font-family: "Manrope", sans-serif !important;
+ font-weight: 800 !important;
+}
+
+.site-title {
+ max-width: 140px;
+}
+
+header.dialog {
+ background-color: #fff !important;
+ border-radius: 8px;
+ margin: 1rem;
+}
+
+.pagefind-ui__search-input {
+ border: 0 !important;
+ border-radius: 6px !important;
+ padding: 0.75rem 1rem !important;
+}
+
+.full-table {
+ width: 100% !important;
+ table-layout:fixed;
+}
+
+.full-table thead,
+.full-table tbody,
+.full-table tr {
+ width: 100% !important;
+}
+
+.full-table td,
+.full-table th {
+ width: 100vw;
+}
+
+.full-table td:nth-child(2) {
+ text-align: center;
+}
+
+code {
+ font-family: "Azeret Mono", monospace !important;
+ border-radius: 4px;
+}
+
+/* Video frame styles */
+.video-frame {
+ border: 2px solid var(--sl-color-accent);
+ border-radius: 8px;
+ padding: 1rem;
+ background: var(--sl-color-accent-low);
+}
+
+/* Hover effect only for non-active sidebar links */
+.sidebar-content a:not([aria-current]):hover {
+ background-color: var(--sl-color-gray-6);
+}
+
+/* Current page styling - no hover effects */
+.sidebar-content .current-page {
+ background-color: var(--sl-color-accent-high);
+ color: var(--sl-color-accent);
+ pointer-events: none;
+}
+
+/* Ensure proper contrast for nested items */
+.sidebar-content li > a.current-page,
+.sidebar-content li > a.current-page:hover,
+.sidebar-content li > a.current-page:focus {
+ background-color: var(--sl-color-accent-high) !important;
+ color: var(--sl-color-accent) !important;
+}
+
+/* Video frame styles */
+.video-frame {
+ border: 2px solid var(--sl-color-accent);
+ border-radius: 8px;
+ padding: 1rem;
+ background: var(--sl-color-accent-low);
+}
\ No newline at end of file
diff --git a/docs/tsconfig.json b/docs/tsconfig.json
new file mode 100644
index 000000000..77da9dd00
--- /dev/null
+++ b/docs/tsconfig.json
@@ -0,0 +1,3 @@
+{
+ "extends": "astro/tsconfigs/strict"
+}
\ No newline at end of file