--- library_name: mlx pipeline_tag: text-generation license: other tags: - mlx - code - sql - text-generation - llm - tennda --- # Tennda-Nano > **A lightweight code LLM independently developed by the Tennda team** > Focused on **efficient, accurate** code generation and instruction following — direct answers, no redundant reasoning. --- ## Model Overview | Item | Details | |---|---| | **Model Name** | Tennda-Nano | | **Developer** | Tennda Team (in-house) | | **Parameters** | Lightweight (<5B) | | **Architecture** | Self-developed Transformer decoder (multimodal input) | | **Weight Format** | bf16, MLX native | | **Framework** | MLX (Apple Silicon Metal GPU acceleration) | | **Training Data** | In-house code instruction dataset (20,022 samples: SQL / Python / algorithms, etc.) | | **Release Date** | 2026-08-21 | --- ## Highlights - **Direct answers**: instruction → immediate code/answer, extremely fast, **short total inference time** - **High SQL accuracy**: 100% correct on unseen SQL tasks - **Clean output**: concise, no verbose reasoning, production-ready answers - **Deployment friendly**: lightweight single-machine inference, low resource usage, suitable for edge/personal devices --- ## Quality Metrics ### Training Convergence (Loss) | Metric | Start | Final | Reduction | |---|---|---|---| | Train loss | 1.929 | **0.963** | -50% | | Val loss | 4.500 | **0.844** | **-81%** | - Stable convergence throughout training, no signs of overfitting (val/train gap remains steady) ### Evaluation Scores (3 unseen samples, temp=0.3) | # | Task Type | Result | |---|---|---| | 1 | SQL conditional query (age>45) | ✅ Directly outputs `SELECT * FROM employees WHERE age > 45;` | | 2 | Design a Car class (Python) | ⚠️ Occasional loop repetition (mitigable via sampling params) | | 3 | SQL aggregate query (MAX salary) | ✅ Directly outputs `SELECT MAX(SALARY) FROM EMPLOYEE;` | **SQL accuracy: 100% (2/2)** **Format alignment (direct answer, no redundant reasoning): 67% (2/3)** > Note: current evaluation is a sampled manual assessment; scores are for reference only. A full evaluation pipeline is under continuous development. --- ## Inference Performance (measured on Apple M4) | Metric | Result | |---|---| | Model load | ~4s | | Single-task generation | **~3.4s** | | Output style | Direct answer (no verbose thinking) | > Total latency reduced by **~83%** on the same task compared with the baseline (output size reduced by 75%). --- ## Training Method - **Architecture**: self-developed Transformer decoder (35 layers, multimodal encoding) - **Method**: in-house lightweight training pipeline (parameter-efficient training, fully local) - **Cost**: 26 minutes on a single machine, peak memory 14.4GB, no large-scale compute cluster required - **Artifact**: complete inference weights (MLX format) > Details in the training report and comparison report. --- ## Usage (MLX) ```python from mlx_lm import load, generate from mlx_lm.sample_utils import make_sampler model, tokenizer = load("MLA299/Tennda-Nano") sampler = make_sampler(temp=0.3, top_p=0.9) prompt = tokenizer.apply_chat_template( [{"role": "user", "content": "Write a SQL query to select employees older than 45."}], add_generation_prompt=True, ) print(generate(model, tokenizer, prompt=prompt, max_tokens=256, sampler=sampler)) ``` Or start an OpenAI-compatible API server: ```bash mlx_lm.server --model MLA299/Tennda-Nano --port 8080 ``` --- ## Deployment Requirements | Config | Requirement | |---|---| | Memory | ≥ 16GB (24GB recommended) | | Platform | Apple Silicon (M-series, Metal GPU) | | Inference | mlx-lm ≥ 0.30 | | Quantization | Can be 4-bit quantized for 8GB-memory devices | --- ## Known Limitations - Chinese instruction capability is still under optimization (training corpus is primarily English code instructions) - Occasional loop repetition (can be mitigated with `repetition_penalty` at inference time) - The concise answer style may omit necessary explanations --- *Tennda-Nano · In-house model · © 2026 Tennda Team*