2 releases
new 0.0.2 | Jan 7, 2025 |
---|---|
0.0.1 | Jan 5, 2025 |
#44 in Machine learning
72 downloads per month
20KB
401 lines
Famulus: AI-Powered LSP Server
Introduction
Famulus, derived from the Latin word for "servant" or "apprentice," refers to a magical attendant who assists a powerful sorcerer in their spells and incantations. As an LSP (Language Server Protocol) server, Famulus is designed to integrate Large Language Models (LLMs) for code completions and code actions, and will be a trusted companion to help you with your sorcery!
Features
- Inline Code Completions: Get context-aware code suggestions using LLMs
- Code Actions: Automate routine tasks, such as code refactoring
Getting Started
You can install Famulus using cargo install famulus
. To use Famulus with your
preferred code editor, please consult your editor's documentation to learn how
to connect to an LSP server.
Configuration
Configuration for Famulus is done via the initializationOptions
object, which
is passed to the server during initialization. This object allows you to customize
the behavior of Famulus, such as specifying the provider for code completions
and configuring its settings.
The configuration options for each provider are as follows:
LlamaCpp
{
"infill": {
"provider": "LlamaCpp",
"config": {
"url": "http://localhost:8080/infill",
"temperature": 0.7,
"max_tokens": 1024,
"stop": ["<|file_separator|>"],
"seed": 42
}
}
}
In order to use llama-cpp you will need a running server. You can launch it using the following command:
llama-server -m codegemma-2b-Q6_K.gguf -c 0 -t 8 -ngl 19 -fa --port 8080
API key can be specified via LLAMA_CPP_API_KEY
environment variable.
Mistral
{
"infill": {
"provider": "Mistral",
"config": {
"url": "https://api.mistral.ai/v1/fim/completions",
"model": "codestral-latest",
"temperature": 0.7,
"top_p": 0.95,
"max_tokens": 1024,
"min_tokens": 1,
"stop": ["\n\n"],
"random_seed": 42
}
}
}
API key can be specified via MISTRAL_API_KEY
environment variable.
Contributing
We welcome contributions to Famulus! If you're interested in helping out, please:
- Fork this repository
- Create a new branch for your feature or bug fix
- Submit a pull request with a detailed description of your changes
License
Famulus is licensed under the AGPL-3.0 License. By contributing to or using Famulus, you agree to the terms and conditions of this license.
Dependencies
~9–22MB
~339K SLoC