Are you fed up of all of those so called "free" Copilot alternatives with paywalls and signups? Fear not my developer friend! Twinny is the most no-nonsense locally hosted (or api hosted) AI code completion plugin for Visual Studio Code and any compatible editors (like VSCodium) designed to work seamlessly with Ollama, Ollama Web UI, llama.cpp, oobabooga/text-generation-webui and LM Studio. Like Github Copilot but 100% free and 100% private.
Fill in the middle code completion:
Chat with AI about your code
🚀 Getting Started
For Visual Studio Code install the verified extension via the Visual Studio Code marketplace by clicking this link or find the extension in the extensions section of Visual Studio Code. For compatible editors (like VSCodium) install the extension from open-vsx.org.
Twinny is configured to use the Ollama API by default, however you can change this to use llama.cpp, LM Studio or Oobabooga by changing the API provider in the extension settings. You can find the settings inside the extension sidebar by clicking the gear icon inside the twinny sidebar or by searching for
Twinny supports the OpenAI API specification so in theory any API should work with Twinny as long as it supports the OpenAI specification. If you find that isn't the case please open an issue with details of how you are having problems.
When choosing an API provider the port and API path names will be updated automatically based on the provider you choose to use. These options can also be set manually.
The option for chat model name and fim model name are only applicable to Ollama and Oobabooga providers.
When the extension is ready you will see a
Enjoy enhanced code completions and chat with twinny! 🎉
Twinny can suggest code either while you are typing in the code editor (these are FIM completions) or you can prompt the model via Twinny's sidebar, in the same way you would chat with any LLM. You can even highlight code in the code editor and ask Twinny via the chat sidebar, to explain the code or provide suggestions. The smaller the size of the model, the faster the response will be.
Models for Chat
Models for Fill in the middle (FIM) completions
In the settings there is an option called
If you have a problem with Twinny or have any suggestions please report them on github issues. Please include your vscode version and OS details in your issue.
We are actively looking for contributors who want to help improve the project, if you are interested in helping out please reach out on twitter.
Contributions are welcome please open an issue describing your changes and open a pull request when ready.
This project is under MIT licence, please read the LICENSE file for more information.
This plugin is provided "as is" and is under active development. This means that at times it may not work fully as expected.