Text Generation
PEFT
MLX
English
French
lora
electronics
embedded
kicad
spice
ailiance
gemma
kicad9plus
Instructions to use Ailiance-fr/gemma-4-E4B-kicad9plus-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Ailiance-fr/gemma-4-E4B-kicad9plus-lora with PEFT:
Task type is invalid.
- MLX
How to use Ailiance-fr/gemma-4-E4B-kicad9plus-lora with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Ailiance-fr/gemma-4-E4B-kicad9plus-lora") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use Ailiance-fr/gemma-4-E4B-kicad9plus-lora with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "Ailiance-fr/gemma-4-E4B-kicad9plus-lora" --prompt "Once upon a time"
- Atomic Chat
Re-license to CC-BY-SA-4.0: training data share-alike inherits
Browse files
README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
base_model: lmstudio-community/gemma-4-E4B-it-MLX-4bit
|
|
|
|
| 4 |
tags:
|
| 5 |
- mlx
|
| 6 |
- lora
|
|
@@ -10,113 +11,75 @@ tags:
|
|
| 10 |
- kicad
|
| 11 |
- spice
|
| 12 |
- ailiance
|
| 13 |
-
-
|
|
|
|
| 14 |
language:
|
| 15 |
- en
|
| 16 |
- fr
|
| 17 |
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Ailiance β
|
| 21 |
|
| 22 |
-
|
| 23 |
-
>
|
| 24 |
-
> This LoRA exhibits **catastrophic forgetting on SPICE tasks** (-15.7 pts composite vs base)
|
| 25 |
-
> and **complete loss of schematic extraction capability** (P3 = 0.000, -30.8 pts vs base).
|
| 26 |
-
> Published as a research artifact to document the failure mode, not for production use.
|
| 27 |
-
>
|
| 28 |
-
> **Hypothesis**: 98 training samples on `kicad9plus-permissive` + rank=8 / scale=20.0 default
|
| 29 |
-
> were insufficient for grammar-style learning, and the high `scale=20.0` over-amplified the
|
| 30 |
-
> small rank-8 deltas onto the base model, breaking unrelated capabilities.
|
| 31 |
-
>
|
| 32 |
-
> **Future iterations may revisit** with rank=32, lower scale, and a larger corpus
|
| 33 |
-
> (e.g. `Ailiance-fr/kicad9plus-copyleft` adds 209 GPL samples for 307 total).
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
## Quick start (for reproduction)
|
| 40 |
|
| 41 |
```python
|
| 42 |
from mlx_lm import load, generate
|
| 43 |
|
| 44 |
model, tokenizer = load(
|
| 45 |
"lmstudio-community/gemma-4-E4B-it-MLX-4bit",
|
| 46 |
-
adapter_path="Ailiance-fr/gemma-4-E4B-kicad9plus-lora"
|
| 47 |
)
|
| 48 |
-
# Expect degraded behaviour on SPICE & extraction tasks.
|
| 49 |
-
```
|
| 50 |
-
|
| 51 |
-
## Training
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
- **Method**: LoRA (PEFT) via `mlx-lm`
|
| 56 |
-
- **Iterations**: 1200
|
| 57 |
-
- **Rank**: 8 *(low β suspected root cause)*
|
| 58 |
-
- **Scale**: 20.0 *(high β suspected root cause)*
|
| 59 |
-
- **Dropout**: 0.0
|
| 60 |
-
- **Learning rate**: 1e-5
|
| 61 |
-
- **Max seq length**: 4096
|
| 62 |
-
- **Layers**: 16 (partial β not all)
|
| 63 |
-
- **Curriculum**: none β single dataset, single pass.
|
| 64 |
-
|
| 65 |
-
The `rank=8 / scale=20.0` combination is the `mlx-lm` lora default and was kept unchanged for this experiment. With only 98 samples, rank 8 likely undersampled the schematic grammar's complexity while the high scale propagated noisy deltas into unrelated capability channels β hence the broken SPICE + extraction scores.
|
| 66 |
-
|
| 67 |
-
## Benchmark results
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
-
|
|
| 72 |
-
|------
|
| 73 |
-
|
|
| 74 |
-
|
|
| 75 |
-
|
|
| 76 |
-
| P2 | kicad-sch-gen | 0.420 | 0.180 | **-24.0pts** |
|
| 77 |
-
| P3 | kicad-sch-extract | 0.308 | 0.000 | **-30.8pts** |
|
| 78 |
-
| P4 | kicad-erc-abs | 0.060 | 0.033 | -2.7pts |
|
| 79 |
-
| P5 | kicad-erc-delta | 0.060 | 0.033 | -2.7pts |
|
| 80 |
|
| 81 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
-
##
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
- Future runs should use `rank=32, scale=2.0` (same as `eukiki` / `mascarade`) plus a larger corpus.
|
| 88 |
|
| 89 |
## EU AI Act compliance
|
| 90 |
|
| 91 |
-
- **Article 53(1)(c)
|
| 92 |
-
- **Article 53(1)(d) training data summary
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
- Licensed data: None.
|
| 96 |
-
- **GPAI Code of Practice (July 2025)**: base model Gemma (Google = signatory).
|
| 97 |
-
- **Provenance**: per-sample `metadata.license_spdx` preserved in upstream dataset.
|
| 98 |
|
| 99 |
## License
|
| 100 |
|
| 101 |
-
-
|
| 102 |
-
- See https://ai.google.dev/gemma/terms
|
| 103 |
|
| 104 |
## Citation
|
| 105 |
|
| 106 |
```bibtex
|
| 107 |
-
@misc{
|
| 108 |
author = {Ailiance},
|
| 109 |
-
title = {Ailiance β
|
| 110 |
year = {2026},
|
| 111 |
publisher = {Hugging Face},
|
| 112 |
-
url = {https://huggingface.co/Ailiance-fr/gemma-4-E4B-kicad9plus-lora}
|
| 113 |
-
note = {Published for transparency; catastrophic forgetting on SPICE and P3 extraction.}
|
| 114 |
}
|
| 115 |
```
|
| 116 |
|
| 117 |
-
## Related
|
| 118 |
|
| 119 |
-
|
| 120 |
-
- [Ailiance-fr/gemma-4-E4B-mascarade-lora](https://huggingface.co/Ailiance-fr/gemma-4-E4B-mascarade-lora) β champion schematic extraction
|
| 121 |
-
- [Ailiance-fr/gemma-4-E4B-aggro-test-lora](https://huggingface.co/Ailiance-fr/gemma-4-E4B-aggro-test-lora) β sanity-check baseline
|
| 122 |
-
- [Ailiance-fr/gemma-4-E4B-kicad9plus-lora](https://huggingface.co/Ailiance-fr/gemma-4-E4B-kicad9plus-lora) β negative result (this model, published for transparency)
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-sa-4.0
|
| 3 |
base_model: lmstudio-community/gemma-4-E4B-it-MLX-4bit
|
| 4 |
+
library_name: peft
|
| 5 |
tags:
|
| 6 |
- mlx
|
| 7 |
- lora
|
|
|
|
| 11 |
- kicad
|
| 12 |
- spice
|
| 13 |
- ailiance
|
| 14 |
+
- gemma
|
| 15 |
+
- kicad9plus
|
| 16 |
language:
|
| 17 |
- en
|
| 18 |
- fr
|
| 19 |
pipeline_tag: text-generation
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# Ailiance β Gemma 4 E4B kicad9plus LoRA
|
| 23 |
|
| 24 |
+
LoRA adapter fine-tuned on `lmstudio-community/gemma-4-E4B-it-MLX-4bit` for the **kicad9plus** domain (electronics, embedded, KiCad, SPICE).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
> Maintained by **Ailiance** β French AI org publishing EU AI Act aligned LoRA adapters and datasets.
|
| 27 |
|
| 28 |
+
## Quick start (MLX)
|
|
|
|
|
|
|
| 29 |
|
| 30 |
```python
|
| 31 |
from mlx_lm import load, generate
|
| 32 |
|
| 33 |
model, tokenizer = load(
|
| 34 |
"lmstudio-community/gemma-4-E4B-it-MLX-4bit",
|
| 35 |
+
adapter_path="Ailiance-fr/gemma-4-E4B-kicad9plus-lora",
|
| 36 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
print(generate(model, tokenizer, prompt="..."))
|
| 39 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
## License chain
|
| 42 |
|
| 43 |
+
| Component | License |
|
| 44 |
+
|-----------------------------------------------|-------------------------------|
|
| 45 |
+
| Base model weights (`lmstudio-community/gemma-4-E4B-it-MLX-4bit`) | Gemma Terms of Use |
|
| 46 |
+
| Training data ([`Ailiance-fr/kicad9plus-permissive`](https://huggingface.co/datasets/Ailiance-fr/kicad9plus-permissive)) | cc-by-sa-4.0 |
|
| 47 |
+
| **LoRA adapter (this repo)** | **CC-BY-SA-4.0** |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
**Rationale**: weights of the base model inherit from the Gemma Terms of Use, but
|
| 50 |
+
the **LoRA adapter is a derivative of CC-BY-SA-4.0 training data** and is therefore
|
| 51 |
+
released under CC-BY-SA-4.0 (share-alike propagates). Downstream users who load
|
| 52 |
+
this adapter against the Gemma base must comply with **both** licenses
|
| 53 |
+
simultaneously.
|
| 54 |
|
| 55 |
+
## Training data lineage
|
| 56 |
|
| 57 |
+
Primary corpus: [`Ailiance-fr/kicad9plus-permissive`](https://huggingface.co/datasets/Ailiance-fr/kicad9plus-permissive) (cc-by-sa-4.0).
|
| 58 |
+
See the [Ailiance-fr catalog](https://huggingface.co/Ailiance-fr) for related cards.
|
|
|
|
| 59 |
|
| 60 |
## EU AI Act compliance
|
| 61 |
|
| 62 |
+
- **Article 53(1)(c)**: training data licenses preserved upstream.
|
| 63 |
+
- **Article 53(1)(d)**: training data summary β see dataset cards on Ailiance-fr.
|
| 64 |
+
- **GPAI Code of Practice (July 2025)**: base model Gemma (Google is a signatory).
|
| 65 |
+
- **No web scraping by Ailiance**, **no licensed data**, **no PII**.
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
## License
|
| 68 |
|
| 69 |
+
LoRA weights: **CC-BY-SA-4.0** (training-data share-alike). Base model weights remain under Gemma Terms of Use.
|
|
|
|
| 70 |
|
| 71 |
## Citation
|
| 72 |
|
| 73 |
```bibtex
|
| 74 |
+
@misc{ailiance_gemma_4_E4B_kicad9plus_lora_2026,
|
| 75 |
author = {Ailiance},
|
| 76 |
+
title = {Ailiance β Gemma 4 E4B kicad9plus LoRA},
|
| 77 |
year = {2026},
|
| 78 |
publisher = {Hugging Face},
|
| 79 |
+
url = {https://huggingface.co/Ailiance-fr/gemma-4-E4B-kicad9plus-lora}
|
|
|
|
| 80 |
}
|
| 81 |
```
|
| 82 |
|
| 83 |
+
## Related
|
| 84 |
|
| 85 |
+
See the full [Ailiance-fr LoRA collection](https://huggingface.co/Ailiance-fr).
|
|
|
|
|
|
|
|
|