daml-fim-7b

A 7B-parameter fill-in-the-middle (FIM) model for Daml code autocompletion: given the code before and after the cursor, it predicts the span in between. It is a fine-tune of Qwen/Qwen2.5-Coder-7B on a curated corpus of Daml source code, built by IntellectEU as part of the Daml Code Assistant project under the Canton Network Development Fund.

These are the same weights that power the hosted Daml Coding Assistant autocompletion service and its VS Code extension.

Benchmark results

Evaluated on the Daml FIM benchmark (exact match on masked spans from held-out files of public Daml repositories, full test split, served at FP8 like the production deployment):

Subset n GitHub Copilot daml-fim-7b Δ (95% CI) McNemar p
Daml 3 (canton, splice) 2,579 28.4% 33.5% +5.1pp [+3.7, +6.4] 2.0e-13
Daml 2 (3 repos) 4,914 17.8% 21.3% +3.5pp [+2.5, +4.4] 5.8e-13
Combined 7,493 21.4% 25.5% +4.0pp [+3.3, +4.8] 1.8e-24

The Daml 3 repositories were part of this model's training data; the benchmark's train/test split is file-level, so none of the evaluated files were seen in training. A cross-validated variant of the same recipe, where the evaluated repositories are excluded from training entirely, scores 32.7% on the Daml 3 subset — see the benchmark repository for both sets of runs and the full methodology.

Usage

The model is a base-style FIM model, not a chat model. Wrap the code around the cursor in the prefix–suffix–middle sentinel layout it was trained on and decode greedily:

<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>

Recommended settings: temperature 0.0, top_p 1.0, max_tokens 128, context window 8192 (keep input under ~7,000 tokens; trim far from the cursor). Strip <|endoftext|> and <|file_separator|> from the output before inserting it.

Example with vLLM:

vllm serve ./daml-fim-7b --served-model-name daml-fim \
  --dtype float16 --max-model-len 8192 --port 8001
curl http://localhost:8001/v1/completions \
  -H 'content-type: application/json' \
  -d '{
    "model": "daml-fim",
    "prompt": "<|fim_prefix|>module Main where\n\ntemplate Iou\n  with\n    issuer : <|fim_suffix|>\n<|fim_middle|>",
    "max_tokens": 128,
    "temperature": 0.0,
    "top_p": 1.0
  }'

On FP8-capable GPUs (NVIDIA Ada/Hopper) with vLLM ≥ 0.20, add --quantization fp8_per_block — it roughly halves median latency on an L4 with no measurable quality loss. Do not use plain --quantization fp8 on vLLM ≥ 0.18 (vllm#41022).

SELF_HOSTING.md in this repository is the complete self-hosting guide: hardware requirements, the full inference contract (context trimming, prompt construction, output cleaning), and how to point the published Daml Coding Assistant VS Code extension at your own server.

Model details

  • Architecture: Qwen2.5 7B (decoder-only); this repository contains full merged weights in safetensors, float16.
  • Training: parameter-efficient fine-tuning on Daml code with a fill-in-the-middle objective, using both syntax-anchored and random spans; the adapter is merged into the base model here.
  • Intended use: editor autocompletion for Daml. It completes code; it is not instruction-tuned and will not follow natural-language requests.
  • Limitations: specialized for Daml (expect no improvement over the base model on other languages); 8,192-token context; quality was validated with greedy decoding only. Completions can be wrong or non-compiling — a human reviews everything it suggests.

License

These weights are licensed under the Business Source License 1.1: you may download, self-host, and make production use of the model free of charge, including commercially — but you may not offer it to third parties as a hosted or managed service whose primary value is the code autocompletion, generation, or analysis the model provides. The license converts to Apache-2.0 on 2030-07-22. See NOTICE for output ownership (yours) and base-model attribution. For alternative licensing arrangements, contact legal@intellecteu.com.

Downloads last month
18
Safetensors
Model size
8B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for intellecteu/daml-fim-7b

Base model

Qwen/Qwen2.5-7B
Finetuned
(116)
this model