MooLLM-1.0-Air-FIM-SQL (Experimental)
MooLLM-1.0-Air-FIM-SQL is an experimental 6.76M-parameter Fill-in-the-Middle (FIM) code completion model built on a pure Mamba2 (State Space Model) architecture, fine-tuned from moomooai/moollm-1.0-air on SQL data.
Status: Experimental / Research Preview
This release serves as a proof-of-concept for ultra-lightweight (~7M parameter) Mamba2 FIM models and local IDE integration (llama.cpp+lsp-ai+ Helix). It demonstrates working end-to-end FIM tokenization and GGUF export, while also illustrating the capacity ceiling of a 6.76M parameter budget on noisy SQL schemas.
Model Details
- Architecture: Pure Mamba2 (State Space Model, no attention layers)
- Parameters: 6.76M
- Context Length: 512 tokens
- Vocabulary Size: 8,208 (base 8,192 BPE + FIM special tokens & padding,
add_prefix_space: false) - Base Model:
moomooai/moollm-1.0-air - Fine-Tuning Dataset:
bigcode/starcoderdata(sqlsubset, ~53M tokens) - Hardware & Framework: Trained from scratch in Rust using
cowllm(Burn + Vulkan backend) on a single AMD Radeon RX 6600 (8 GB) - License: MIT
FIM Prompt Format (PSM)
The model uses the standard Prefix-Suffix-Middle (PSM) template:
<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>{middle}<|endoftext|>
Special Tokens
<|fim_prefix|>(id: 8192)<|fim_suffix|>(id: 8193)<|fim_middle|>(id: 8194)<|endoftext|>(EOS token)
Usage with llama.cpp
1. Start llama-server
llama-server -m model.gguf --port 9931 -c 512
2. Query /v1/completions
curl -s http://localhost:9931/v1/completions \
-H "Content-Type: application/json" \
-d '{
"prompt": "<|fim_prefix|>CREATE TABLE orders (\n id SERIAL PRIMARY KEY,\n user_id INTEGER NOT NULL REFERENCES users(id),\n status VARCHAR(50) NOT NULL DEFAULT '\''pending'\'',\n <|fim_suffix|>\n updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP\n);<|fim_middle|>",
"max_tokens": 32,
"temperature": 0.2,
"repeat_penalty": 1.15,
"stop": ["<|endoftext|>", "<|fim_prefix|>", "<|fim_suffix|>", "<|fim_middle|>", ";"]
}'
IDE Integration (Helix + lsp-ai)
You can run this model locally as a real-time inline autocomplete server in Helix via lsp-ai.
Add the following to ~/.config/helix/languages.toml:
[language-server.lsp-ai]
command = "lsp-ai"
environment = { "OPENAI_API_KEY" = "dummy" }
[language-server.lsp-ai.config.memory]
file_store = {}
[language-server.lsp-ai.config.models.local_fim]
type = "open_ai"
completions_endpoint = "http://localhost:9931/v1/completions"
model = "model"
auth_token_env_var_name = "OPENAI_API_KEY"
[language-server.lsp-ai.config.completion]
model = "local_fim"
[language-server.lsp-ai.config.completion.parameters]
max_context = 1250
max_tokens = 40
temperature = 0.2
top_p = 0.9
repeat_penalty = 1.15
stop = ["<|endoftext|>", "<|fim_prefix|>", "<|fim_suffix|>", "<|fim_middle|>", ";"]
[language-server.lsp-ai.config.completion.parameters.fim]
start = "<|fim_prefix|>"
middle = "<|fim_suffix|>"
end = "<|fim_middle|>"
[[language]]
name = "sql"
language-servers = ["lsp-ai"]
Intended Use & Limitations
- Intended Use: Research into sub-10M State Space Models for code infilling, benchmarking Mamba2 FIM scaling laws, and testing ultra-fast local IDE autocomplete pipelines (>500 tok/s on CPU).
- Known Limitations:
- Parameter Ceiling (6.76M): With only 6.76M parameters, the model works best on structured multi-line SQL contexts (e.g.,
CREATE TABLEdefinitions) and struggles to infer arbitrary table/column names on very short prompts. - Generation Length: Keep
max_tokenslow (32–40) withrepeat_penalty = 1.15; longer generations may loop on repetitive tokens. - Dataset Artifacts: Fine-tuned on raw
starcoderdata/sqlspans, which include database dump snippets.
- Parameter Ceiling (6.76M): With only 6.76M parameters, the model works best on structured multi-line SQL contexts (e.g.,