Tired of the so-called "free" Copilot alternatives that are filled with paywalls and signups? Look no further, developer friend!
Twinny is your definitive, no-nonsense AI code completion plugin for Visual Studio Code and compatible editors like VSCodium. It's designed to integrate seamlessly with various tools and frameworks:
Setup with Other Providers llama.cpp / LM Studio / Oobabooga / LiteLLM or any other provider
For setups with llama.cpp, LM Studio, Oobabooga, LiteLLM, or any other provider, you can find more details on provider configurations and functionalities here in providers.md.
Obtain and run your chosen model locally using the provider's setup instructions.
Restart VS Code if necessary and press CTRL + SHIFT + T to open the side panel.
At the top of the extension, click the 🔌 (plug) icon to configure your FIM and chat endpoints in the providers tab.
It is recommended to use separate models for FIM and chat as they are optimized for different tasks.
Update the provider settings for chat, including provider, port, and hostname to correctly connect to your chat model.
After setup, the 🤖 icon should appear in the sidebar, indicating that Twinny is ready for use.
Results may vary from provider to provider especailly if using the same model for chat and FIM interchangeably.
With Non-Local API Providers e.g, OpenAI GPT-4 and Anthropic Claude
Twinny supports OpenAI API-compliant providers.
Use LiteLLM as your local proxy for the best compatibility.
If there are any issues, please open an issue on GitHub with details.
Model Support
Models for Chat:
For powerful machines: deepseek-coder:6.7b-base-q5_K_M or codellama:7b-instruct.
For less powerful setups, choose a smaller instruct model for quicker responses, albeit with less accuracy.
Models for FIM Completions:
High performance: deepseek-coder:base or codellama:7b-code.
Lower performance: deepseek-coder:1.3b-base-q4_1 for CPU-only setups.
Keyboard Shortcuts
Shortcut
Description
ALT+\
Trigger inline code completion
CTRL+SHIFT+/
Stop the inline code generation
Tab
Accept the inline code generated
CTRL+SHIFT+Z CTRL+SHIFT+T
Open Twinny sidebar
CTRL+SHIFT+Z CTRL+SHIFT+G
Generate commit messages from staged changes
Workspace Context
Enable fileContextEnabled in settings to improve completion quality by tracking sessions and file access patterns. This is off by default to ensure performance.
Known Issues
Visit the GitHub issues page for known problems and troubleshooting.
Contributing
Interested in contributing? Reach out on Twitter, describe your changes in an issue, and submit a PR when ready. Twinny is open-source under the MIT license. See the LICENSE for more details.
Disclaimer
Twinny is actively developed and provided "as is". Functionality may vary between updates.