Instructions to use intellecteu/daml-fim-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intellecteu/daml-fim-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="intellecteu/daml-fim-7b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("intellecteu/daml-fim-7b") model = AutoModelForCausalLM.from_pretrained("intellecteu/daml-fim-7b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use intellecteu/daml-fim-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "intellecteu/daml-fim-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intellecteu/daml-fim-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/intellecteu/daml-fim-7b
- SGLang
How to use intellecteu/daml-fim-7b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "intellecteu/daml-fim-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intellecteu/daml-fim-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "intellecteu/daml-fim-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intellecteu/daml-fim-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use intellecteu/daml-fim-7b with Docker Model Runner:
docker model run hf.co/intellecteu/daml-fim-7b
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