EPLAN Electric P8 2027 API Assistant — Qwen3.5-9B LoRA (v3)

LoRA adapter that turns Qwen/Qwen3.5-9B into an EPLAN API specialist: answers questions about EPLAN 2027 classes and members, generates C# automation scripts for the EPLAN scripting engine (Eplan.EplApi.*), diagnoses compile/runtime errors, and refuses to invent undocumented APIs — bilingual EN/ES.

Keywords: EPLAN API · EPLAN 2027 · EPLAN scripting · EPLAN C# automation · Eplan.EplApi · Electric P8

Base model License LoRA GGUF Q4_K_M Dataset

This repo contains v3 — the balanced variant: strong identifier precision plus the best-corrected refusal behaviour of the surviving line. If you want the most conservative variant instead, see covaga/eplan-2027-lora-v4. v1/v2 were deleted.


🚀 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 peft
from unsloth import FastLanguageModel
from 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-v3")
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.

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 1 0/9
v2 (deleted) 130 67% 43 36/44 2 1/9
v3 — this repo 126 63% 47 33/44 2 4/9
v4 111 62% 42 33/44 2 4/9¹

¹ v4 reaches 5/9 semantically — the scorer's regex misses one genuine refusal.

Clean test split (60 questions, documents never seen in training):

Model Valid IDs expect_ids Forbid viol.
v3 — this repo 63% 60/60 0
v4 pending pending pending

🧭 Which version should you use?

Version Character Recommendation
v3 (this repo) Balanced: solid precision + best refusal behaviour Default choice for most use cases
v4 Most conservative: fewest IDs cited (111) and fewest invented (42) Pick when fabrication avoidance matters more than coverage
v1 / v2 Superseded, deleted —

💻 Running locally — minimum specs

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) GPU ≥24 GB VRAM — Needs the base 9B loaded in BF16 (~19 GB) plus PEFT overhead

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.

🔌 Ground it — RAG & tooling ecosystem

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.

📦 Usage notes & related artifacts

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

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 covaga/eplan-2027-api-qa — 17,328 rows, document-level split — plus generated refusal/ambiguity/error examples verified against the official EPLAN 2027 docs
Epochs 1
Hardware / runtime A100-80GB, ~53 min
Peak VRAM 19.2 GiB
Final loss ~0.78
Framework Unsloth + transformers>=5

📚 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-v3,
  author       = {covaga},
  title        = {EPLAN Electric P8 2027 API Assistant — Qwen3.5-9B LoRA (v3)},
  year         = {2025},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/covaga/eplan-2027-lora-v3}}
}

🇪🇸 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. v3 es la variante equilibrada (precisión + negativas); para máxima prudencia usa eplan-2027-lora-v4. Compila siempre los scripts en EPLAN real antes de producción — puede seguir inventando identificadores plausibles en una minoría de casos.

Downloads last month
30
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for covaga/eplan-2027-lora-v3

Finetuned
Qwen/Qwen3.5-9B
Adapter
(785)
this model