Text Generation
Transformers
Safetensors
English
qwen2
serverlex
code-generation
diagnostics
machine-learning
tabular
lora
auto-copilot
conversational
text-generation-inference
Instructions to use Uwais-ML-dev/serverlex-copilot-0.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Uwais-ML-dev/serverlex-copilot-0.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Uwais-ML-dev/serverlex-copilot-0.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Uwais-ML-dev/serverlex-copilot-0.5b") model = AutoModelForCausalLM.from_pretrained("Uwais-ML-dev/serverlex-copilot-0.5b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Uwais-ML-dev/serverlex-copilot-0.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Uwais-ML-dev/serverlex-copilot-0.5b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Uwais-ML-dev/serverlex-copilot-0.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Uwais-ML-dev/serverlex-copilot-0.5b
- SGLang
How to use Uwais-ML-dev/serverlex-copilot-0.5b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Uwais-ML-dev/serverlex-copilot-0.5b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Uwais-ML-dev/serverlex-copilot-0.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Uwais-ML-dev/serverlex-copilot-0.5b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Uwais-ML-dev/serverlex-copilot-0.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Uwais-ML-dev/serverlex-copilot-0.5b with Docker Model Runner:
docker model run hf.co/Uwais-ML-dev/serverlex-copilot-0.5b
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- serverlex
|
| 7 |
+
- code-generation
|
| 8 |
+
- diagnostics
|
| 9 |
+
- machine-learning
|
| 10 |
+
- tabular
|
| 11 |
+
- lora
|
| 12 |
+
- auto-copilot
|
| 13 |
+
base_model: Qwen/Qwen2.5-0.5B-Instruct
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
+
library_name: transformers
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Serverlex Copilot 0.5B ⚡
|
| 19 |
+
|
| 20 |
+
**Serverlex Copilot 0.5B** is an offline, specialized AI diagnostic agent fine-tuned exclusively for [Serverlex](https://github.com/Uwais-ML/Serverlex)—the production-safe machine learning preprocessing, diagnostics, and serving platform.
|
| 21 |
+
|
| 22 |
+
At just **0.5 Billion parameters (~980MB in fp16, ~340MB in 4-bit)**, this model is lightweight enough to run locally on standard CPUs, Apple Silicon Macs, or edge environments with **zero external API calls or GPU requirements**.
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## 📌 Capabilities
|
| 27 |
+
|
| 28 |
+
1. **Pre-Flight Data Quality Audit Triage**:
|
| 29 |
+
- Analyzes `DataGuard` logs and audit reports.
|
| 30 |
+
- Detects and explains ID memorization hazards, PII privacy concerns, and infinite value defects.
|
| 31 |
+
2. **Mathematical Target Leakage Mitigation**:
|
| 32 |
+
- Identifies suspicious proxy features ($|r| \ge 0.90$) and writes exact code to drop or remediate them.
|
| 33 |
+
3. **Production Drift Interpretation**:
|
| 34 |
+
- Interprets `DriftDetector` Population Stability Index (PSI) and Kolmogorov-Smirnov (KS) statistics.
|
| 35 |
+
- Prescribes retraining strategies and automated webhook alerting configurations.
|
| 36 |
+
4. **Hardened Serving & Cryptographic Verification**:
|
| 37 |
+
- Diagnoses HMAC-SHA256 signature verification mismatches and tamper attempts in `ModelDeployer`.
|
| 38 |
+
- Explains strict schema validation errors (unseen categories, missing features, invalid types).
|
| 39 |
+
5. **End-to-End Workflow Synthesis**:
|
| 40 |
+
- Generates production-ready, leakage-free Serverlex code (cleaners, pipeline encoders, nested CV tuners, and containerized FastAPI exports).
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## 🚀 Quickstart & Inference
|
| 45 |
+
|
| 46 |
+
### 1. Directly via Serverlex (Recommended)
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
import serverlex
|
| 50 |
+
|
| 51 |
+
# Enable real-time automatic exception interception & guidance
|
| 52 |
+
serverlex.enable_auto_copilot()
|
| 53 |
+
|
| 54 |
+
# Or use the standalone Copilot agent
|
| 55 |
+
from serverlex import ServerlexCopilot
|
| 56 |
+
|
| 57 |
+
copilot = ServerlexCopilot()
|
| 58 |
+
log = "2026-11-06 10:39:12 [ERROR] DataGuard: Suspicious target leakage: feature post_op_charges has correlation 0.9842 with target total_hospital_cost"
|
| 59 |
+
|
| 60 |
+
print(copilot.diagnose_log(log))
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### 2. Via Hugging Face `transformers`
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 67 |
+
import torch
|
| 68 |
+
|
| 69 |
+
MODEL_ID = "Uwais-ML-dev/serverlex-copilot-0.5b"
|
| 70 |
+
|
| 71 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
| 72 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 73 |
+
MODEL_ID,
|
| 74 |
+
torch_dtype=torch.float16,
|
| 75 |
+
device_map="auto"
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
prompt = """### Instruction:
|
| 79 |
+
Analyze this Serverlex log and output the fix.
|
| 80 |
+
|
| 81 |
+
### Input:
|
| 82 |
+
2026-11-06 10:39:12 [ERROR] DataGuard: Suspicious target leakage: feature 'hospital_charges' has correlation 0.9842 with target 'total_hospital_cost'
|
| 83 |
+
|
| 84 |
+
### Response:
|
| 85 |
+
"""
|
| 86 |
+
|
| 87 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 88 |
+
outputs = model.generate(**inputs, max_new_tokens=300, do_sample=False)
|
| 89 |
+
print(tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True))
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## 🏋️ Training Details
|
| 95 |
+
|
| 96 |
+
- **Base Architecture**: `Qwen/Qwen2.5-0.5B-Instruct`
|
| 97 |
+
- **Methodology**: LoRA (Low-Rank Adaptation) merged into standalone fp16 base weights
|
| 98 |
+
- Rank ($r$): 16
|
| 99 |
+
- Alpha ($\alpha$): 32
|
| 100 |
+
- Target Modules: `q_proj`, `k_proj`, `v_proj`, `o_proj`
|
| 101 |
+
- **Dataset**: 5,150 curated instructional pairs covering real Serverlex logs, multi-step recipes, and diagnostics.
|
| 102 |
+
- **Hardware**: Fine-tuned on a single NVIDIA T4 GPU in Google Colab.
|
| 103 |
+
- **Final Training Loss**: 0.1472
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
|
| 107 |
+
## 📄 License & Attribution
|
| 108 |
+
|
| 109 |
+
Released under the **MIT License**. Created by the Serverlex Team as part of the **Serverlex 2.0 Platform**.
|