--- license: apache-2.0 base_model: Qwen/Qwen3.5-4B language: - en pipeline_tag: text-generation library_name: transformers tags: - code - rust - lindot --- # Lin-1 Locus **Lin-1 Locus** is a 4B-parameter code model from LindotAI, specialized for **Rust**. It is fine-tuned from [Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) on curated, test-verified Rust data and answers directly (no long reasoning traces), which keeps it fast enough for local use. ## Highlights - Writes idiomatic, compiling Rust: functions, traits, generics, error handling, iterators, unit tests. - Trained only on code that passed compilation and/or its own tests. - Strong sampling diversity: high pass@10 makes it a good fit for generate-and-test loops. - Runs locally: a Q8_0 GGUF is included (~4.5 GB). ## Benchmarks ![Lin-1 Locus vs open code models](benchmarks_wide.png) ![Benchmarks](benchmarks.png) All numbers measured by us with the same harness for every model (Rust ports of the benchmarks; generated code is compiled and run against the tests). | Model | HumanEval-Rust p@1 / p@10 | MBPP-Rust p@1 / p@10 | Holdout (Rust) | LBPP-Rust | |---|---|---|---|---| | **Lin-1 Locus (4B)** | **73.1 / 86.1** | **63.4 / 73.1** | **58.7** | **27.5** | | Lin-1 Epsilon Preview (0.5B) | 48.4 / 65.2 | 41.3 / 54.2 | 30.3 | 4.1 | | Temper 2 Nodel | 73.3 / 81.8 | 64.7 / 70.6 | 55.4 | 26.4 | | Qwen2.5-Coder-7B-Instruct | 72.4 / 82.6 | 60.5 / 70.0 | — | — | | Qwen3.5-4B (base) | 66.2 / 81.4 | 57.7 / 73.4 | — | — | | Qwen3-4B | 59.8 / 64.8 | 55.6 / 60.6 | — | — | | Qwen2.5-Coder-3B-Instruct | 56.5 / 71.9 | 44.8 / 60.0 | — | — | | Qwen2.5-Coder-1.5B-Instruct | 39.0 / 56.1 | 38.3 / 52.1 | — | — | | Qwen3.5-2B | 31.7 / 51.3 | 36.0 / 53.2 | — | — | *Holdout* is our private set of Rust tasks with tests that was never used for training. ## Quick start ### Transformers ```python from transformers import AutoTokenizer, AutoModelForCausalLM model_id = "LindotAI/Lin-1-Locus" tok = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto") messages = [{"role": "user", "content": "Write a Rust function that returns the n-th Fibonacci number using u128, with tests."}] inputs = tok.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False, return_tensors="pt").to(model.device) out = model.generate(inputs, max_new_tokens=1024, temperature=0.2, do_sample=True) print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True)) ``` ### vLLM ```bash vllm serve LindotAI/Lin-1-Locus --max-model-len 8192 ``` ### llama.cpp / Ollama (GGUF) ```bash llama-cli -m Lin-1-Locus-Q8_0.gguf -p "Write a Rust function that parses a CSV line into Vec." ``` Recommended sampling: `temperature 0.2` for single answers, `0.8` when sampling several candidates and testing them. ## Training 1. Supervised fine-tuning of Qwen3.5-4B on Rust instruction data and the model's own test-verified answers (rejection sampling). 2. Supervised fine-tuning on curated Rust from permissively licensed sources: files from *The Stack Edu* (Rust subset) that compile and pass their own unit tests, and compile-checked samples from *Strandset-Rust*. All training data was decontaminated against the evaluation sets (12-gram overlap filter). ## Limitations - Focused on Rust; other languages work but are not the target. - 4B parameters: complex multi-file projects and long-horizon agentic tasks remain hard. - Always compile and test generated code. ## License Apache 2.0, same as the base model.