🚀 Quickstart
Requires transformers>=5 and a Hugging Face token (this repo is private — run hf auth login first). The adapter is a standard PEFT checkpoint, fully Unsloth-compatible.
# pip install "transformers>=5" unsloth peftfrom unsloth import FastLanguageModelfrom peft import PeftModel model, tokenizer = FastLanguageModel.from_pretrained( "Qwen/Qwen3.5-9B", max_seq_length=4096, load_in_16bit=True, # adapter trained in BF16)model = PeftModel.from_pretrained(model, "covaga/eplan-2027-lora-v4")FastLanguageModel.for_inference(model) messages = [{"role": "user", "content": "Which EPLAN 2027 API class creates a new project? Show a minimal C# script."}] inputs = tokenizer.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda") out = model.generate(inputs, max_new_tokens=512, temperature=0.2)print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
🧠 What it does
- EPLAN 2027 API reference Q&A — explains classes, members and namespaces of the EPLAN Electric P8 2027 API (
Eplan.EplApi.DataModel, Eplan.EplApi.HEServices, …) in English or Spanish.
- C# script generation — produces scripts for EPLAN's scripting engine. Training data constrained output to C# 5-era syntax for safety; EPLAN 2027 actually compiles C# 13 via Roslyn, so you can modernize the generated code freely.
- Error diagnosis — explains EPLAN script compile/runtime errors and suggests fixes.
- Calibrated refusals — trained to say "this API does not exist" instead of hallucinating plausible-looking identifiers (see benchmarks — still imperfect).
- Bilingual EN/ES — questions and answers work in both languages.
📊 Benchmarks
Curated 44-question eval (covaga/eplan-2027-eval): API reference, C# codegen, error diagnosis, unanswerable questions, invented-API traps, EN/ES, multi-constraint prompts. Valid % = cited identifiers that exist in the official EPLAN 2027 docs; invented = identifiers not in the docs; refusals = correct refusals on the 9 trap questions.
Table with columns: Model, IDs cited, Valid IDs, Invented IDs, expect_ids, Forbid viol., Refusals (/9)| Model | IDs cited | Valid IDs | Invented IDs | expect_ids | Forbid viol. | Refusals (/9) |
|---|
| Qwen3.5-9B (base) | 401 | 43% | 230 | 33/44 | 5 | 1/9 |
| v1 (deleted) | 133 | 59% | 55 | 35/44 |
¹ This model reaches 5/9 semantically — the scorer's regex misses one genuine refusal.
Clean test split (60 questions, documents never seen in training):
Table with columns: Model, Valid IDs, expect_ids, Forbid viol.| Model | Valid IDs | expect_ids | Forbid viol. |
|---|
| v3 | 63% | 60/60 | 0 |
| v4 — this repo | pending | pending | pending |
🧭 Which version should you use?
Table with columns: Version, Character, Recommendation| Version | Character | Recommendation |
|---|
| v4 (this repo) | Most conservative: fewest IDs cited (111) and fewest invented (42) | Pick when fabrication avoidance matters more than coverage |
| v3 | Balanced: solid precision + best refusal behaviour | Default choice for most use cases |
| v1 / v2 | Superseded, deleted | — |
💻 Running locally — minimum specs
Table with columns: Build, File size, Minimum, Comfortable, Notes| Build | File size | Minimum | Comfortable | Notes |
|---|
| GGUF Q4_K_M | 5.6 GB + 0.9 GB mmproj | ~8 GB free RAM | 12–16 GB RAM, or GPU with ≥8 GB VRAM | Best option — CPU-friendly via llama.cpp; works on Apple Silicon (llama-mtmd-cli) |
| Merged BF16 | 18.8 GB | GPU ≥24 GB VRAM | A100/RTX 3090+ | CPU inference possible at ~24 GB+ RAM but very slow |
| LoRA adapter | 233 MB (+ base) |
Recommended local path: GGUF Q4_K_M through llama.cpp / LM Studio / Ollama-compatible runners. For anything serious, pair it with retrieval (below) — grounding the model with real docs is the single biggest quality win.
This model answers from memory; pairing it with the official EPLAN 2027 documentation dramatically improves accuracy and cuts hallucinations. The ecosystem around it:
covagashi/eplan-rag-mcp — MCP server + tooling for EPLAN automation: official 2027 action registries, live actions and ribbon labels. Gives an agent real, verified EPLAN identifiers instead of guesses.
covagashi/eplan-cloudflare-rags — Cloudflare-hosted RAG over the official EPLAN 2027 docs (live endpoint rag2027.covaga.xyz, /search + /file). Feed retrieved doc pages into the prompt to ground answers.
covagashi/eplan-development-skill — curated EPLAN development reference (actions, data access, remoting, pitfalls, E3D) usable as an agent skill or as grounded context.
In our eval, retrieval alone lifted refusal accuracy on invented-API traps from 1/9 to 4/9 — combining the adapter with RAG is the intended production setup.
Sample prompts
EN Which EPLAN 2027 API class lets me enumerate all pages of the open project?EN Write a C# script for EPLAN that exports every schematic page to PDF.ES ¿Qué clase de la API de EPLAN 2027 permite crear un proyecto nuevo?ES Escribe un script en C# que recorra todas las páginas del proyecto abierto.
⚠️ Limitations
Read before production use.
- Still fabricates sometimes. On invented-API traps the model refuses only ~4–5/9 times — it can emit plausible-sounding identifiers that do not exist in EPLAN.
- Refusals leak inventions. Even correct refusals occasionally suggest made-up alternative APIs.
- Valid identifier ≠ correct code. A real class name can still be used with the wrong signature or semantics.
- Always compile in real EPLAN before shipping a generated script; the model targets a C# 5-era subset while EPLAN 2027 compiles C# 13 via Roslyn.
- Text-only. The vision tower of Qwen3.5-9B was not trained — no image/screenshot understanding of EPLAN UIs.
- Synthetic data risk. The dataset was generated and filtered automatically; upstream errors may have been inherited. Verify against the official EPLAN 2027 documentation.
- Base model
Qwen/Qwen3.5-9B retains its own license terms.
🏋️ Training details
Table with columns: Setting, Value| Setting | Value |
|---|
| Method | LoRA (PEFT / Unsloth), BF16 |
| Base model | Qwen/Qwen3.5-9B |
| Rank / α / dropout | r=32 · α=32 · 0 |
| Trainable params | 58.2M |
| Target modules | Full attention + MLP — Unsloth finetune_* filters exclude DeltaNet-specific projections |
| Sequence length | 2,048 tokens, loss on responses only |
| Data | — 17,328 rows, document-level split — plus generated refusal/ambiguity/error examples verified against the official EPLAN 2027 docs |
📚 Dataset
Trained on covaga/eplan-2027-api-qa (public): 17,328 QA/codegen rows built from the official EPLAN Electric P8 2027 API documentation, split at document level so no document leaks between train/test.
📝 Citation
@misc{eplan-2027-lora-v4, author = {covaga}, title = {EPLAN Electric P8 2027 API Assistant — Qwen3.5-9B LoRA (v4)}, year = {2025}, publisher = {Hugging Face}, howpublished = {\url{https://huggingface.co/covaga/eplan-2027-lora-v4}}}
🇪🇸 Español
Adaptador LoRA (BF16, r=32) sobre Qwen/Qwen3.5-9B que convierte el modelo en un asistente de la API de EPLAN Electric P8 2027: responde preguntas sobre clases y miembros de Eplan.EplApi.*, genera scripts de C# para el motor de scripting de EPLAN, diagnostica errores de compilación/ejecución y rechaza inventar APIs no documentadas. Bilingüe ES/EN. v4 es la variante más conservadora (menos identificadores citados e inventados); para mejor equilibrio precisión/negativas usa eplan-2027-lora-v3. Compila siempre los scripts en EPLAN real antes de producción — puede seguir inventando identificadores plausibles en una minoría de casos.