Exploring Ghostwriter, a GitHub Copilot alternative
Tags: github, webdev
Published: 2022-11-08 20:45:51

**Written by [Ukeje Goodness](https://blog.logrocket.com/author/ukejegoodness/)✏️**


With the advent of artificial intelligence (AI), developers and individuals across many walks of life have explored using the technology in various fields. In October 2021, GitHub released the [Copilot AI tool](https://blog.logrocket.com/building-github-copilot-app/) that shipped with IDE extensions for code autocompletion. Copilot has since garnered great popularity because of its effectiveness. 

[Replit](https://replit.com/) is one of the most popular online-based IDEs, and in September 2022, they announced that they had [added support for an AI Mode](https://blog.replit.com/ai) that incorporated modern AI into their IDE features. The AI Mode includes a machine learning-enabled pair programmer to complete your code, among other features, with the goal of increasing your productivity. 

In this article, you’ll learn about Replit’s Ghostwriter, its features, and how you can use Ghostwriter in your REPLs. We’ll cover the following:

*   [What is Ghostwriter?](#what-is-ghostwriter)
*   [How Ghostwriter works](#how-ghostwriter-works)
*   [Ghostwriter’s features](#ghostwriter-features)
    *   [Code suggestion and autocompletion](#ghostwriter-code-suggestion-autocompletion)
    *   [Code generation](#ghostwriter-code-generation)
    *   [Code explanations](#ghostwriter-code-explanations)
    *   [Semantic search](#ghostwriter-semantic-search)
*   [Why you should use Ghostwriter](#why-you-should-use-ghostwriter)
*   [What’s next for Ghostwriter](#whats-next-for-ghostwriter)
*   [Ghostwriter vs. Copilot](#ghostwriter-vs-copilot)

## What is Ghostwriter?

![GhostWriter](https://blog.logrocket.com/wp-content/uploads/2022/10/ghostwriter.png) 

Ghostwriter is an AI engine for the online Replit IDE that helps with code autocompletion and development by recommending code based on your operations. The experience of working with Ghostwriter is similar to Replit’s Multiplayer Mode, except that you get to collaborate with the AI as a pair programmer that recommends code to fit your use case. 

Ghostwriter is rumored to be over twice as fast as GitHub’s Copilot AI, making web development faster while reducing much of the hassle and increasing productivity. Ghostwriter was publicly released on 31 October 2022 as part of the Replit AI Mode. Like Copilot, [Ghostwriter is a paid service](https://replit.com/pricing).

## How Ghostwriter works

![How GhostWriter Works](https://blog.logrocket.com/wp-content/uploads/2022/10/how-ghostwriter-works.png) 

Ghostwriter suggests your subsequent lines and statements of code by analyzing previous lines you’ve written in the language, the packages you installed, and other interactions. 

Replit built Ghostwriter on the open source scene based on [Salesforce’s Codegen](https://github.com/salesforce/CodeGen), using [Nvidia’s FasterTransformer](https://github.com/NVIDIA/FasterTransformer) and [Triton server](https://github.com/triton-inference-server/server) for highly optimized decoders, and the knowledge distillation process of the CodeGen model from two billion parameters to a faster model of one billion parameters.

## Ghostwriter’s features <a name="ghostwriter-features">

Ghostwriter is similar to many other programming AI applications but it includes improvements and features that you won’t find in other AI tools. 

Here are a few of the features Ghostwriter enables you to use in your code REPLs:

### Code suggestion and autocompletion <a name="ghostwriter-code-suggestion-autocompletion">

Ghostwriter suggests autocompletions for your code, and functions for speedy development in a simple and interactive manner, similar to using a regular pair programming tool.

### Code generation <a name="ghostwriter-code-generation">

With Ghostwriter, you can generate lines of code, functions, files, and programs. Replit introduced the “[Generate Code](https://blog.replit.com/generate-code)” feature in June 2022, featuring an AI that generates code from your word specification. 

With Ghostwriter, you get to describe the program's behavior or function, and the AI returns the code for your app’s development.

### Code explanations <a name="ghostwriter-code-explanations">

Replit provides an **Explain Code** button for code explanations powered by OpenAI’s codex: ![GhostWriter Explain Code Feature](https://blog.logrocket.com/wp-content/uploads/2022/10/ghostwriter-explain-code-feature.png) 

You select the code in your editor and then choose the **Explain Code** feature that presents an explanation of your specified line or code, function, or any other parts of your code.

### Semantic search <a name="ghostwriter-semantic-search">

Semantic search is one of the most useful features in Replit’s AI Mode. With semantic search, you can enter a query for code and retrieve code results that match your query. 

The tool returns multiple results of code snippets from popular open source repositories that you can use in your project.

## Why you should use Ghostwriter

Ghostwriter and the other AI Mode features are among the most significant upgrades to Replit over the years, especially for speedy development. 

With Ghostwriter as your pair programmer enabling you to quickly write functional code, you will eventually reduce your development time. 

Ghostwriter’s code explanation feature also boosts collaboration among teams because you can easily use the feature to check for code functionalities without going through the hassle of communication. 

Because Replit doesn’t share your code from the AI Mode features, and Ghostwriter is just a code recommendation tool, you can use the AI for critical purposes. Replit only asks for feedback so they can improve the AI for yourself and other users. You retain the right of your REPLs depending on the license of your REPL.

## What’s next for Ghostwriter

Ghostwriter is now available for public use as part of Replit’s AI Mode and you’ll be able to use the AI tool in any of your REPLs, irrespective of the license. 

Replit hopes to improve Ghostwriter’s features for better productivity and workflows. Features for learning new concepts, code analysis, and more will be available in the AI Mode. In the future, Ghostwriter will also include post-training quantization of weights, activation to `int8` precision, optimized kernels for reduced latency, and, eventually, higher model accuracy. 

Replit is also planning for Ghostwriter to feature autoregressive language models for improved interactivity and further training of the LLMs (Large Language Models) with deep reinforcement learning for features like user feedback, test accuracy, and runtime errors.

## Ghostwriter vs. Copilot

Ghostwriter and Copilot are code AI tools, and they share similar features. Just like Ghostwriter, Copilot supports automatic code completion, and Copilot has a feature similar to Replit’s Codegen for generating code based on specific queries. 

The tools support code generation and code explanation with OpenAI’s codex; however, there are distinct features for each of them. 

Copilot supports extra features, like unit testing and generating complex algorithms to match conventions and contexts, which Ghostwriter does not. Ghostwriter is also only available on Replit’s editor, unlike Copilot, which is available on many IDEs and editors from VS Code to all JetBrains IDEs (WebStorm, GoLand, etc). 

You can check out [this article](https://blog.logrocket.com/building-github-copilot-app/) to learn more about GitHub’s Copilot AI tool and how you can get started developing with the tool.

<table>

<tbody>

<tr>

<th>Feature</th>

<th>Replit’s Ghostwriter</th>

<th>GitHub’s Copilot</th>

</tr>

<tr>

<td>Code completion</td>

<td>Yes</td>

<td>Yes</td>

</tr>

<tr>

<td>Availability</td>

<td>Replit</td>

<td>VS Code, JetBrains IDEs, and more</td>

</tr>

<tr>

<td>Code generation</td>

<td>Yes</td>

<td>Yes</td>

</tr>

<tr>

<td>Other features</td>

<td></td>

<td>Testing and complex algorithm generation</td>

</tr>

</tbody>

</table>

## Conclusion

In this article, you learned about the features of Replit’s Ghostwriter, an AI engine that helps with code autocompletion, and compared it to GitHub’s Copilot. Since Ghostwriter is only available on Replit, you can use the AI when you use Replit, and choose Copilot when you’re using your favorite IDE apps.