Instructions to use OrhanDerin/Deepseek-SBX-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use OrhanDerin/Deepseek-SBX-finetuned with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
DeepSeek Samba Command Generator (sbx-api)
This repository contains a locally fine-tuned DeepSeek-Coder-1.3b-base model designed to convert natural language requests into precise terminal commands for SAMBA administration.
The model was fine-tuned using LoRA (Low-Rank Adaptation) on a custom dataset of Samba command scenarios. This repository provides both the LoRA adapters and the fully merged standalone model.
Model Details
- Model Type: Causal Language Model (Fine-tuned)
- Base Architecture:
deepseek-ai/deepseek-coder-1.3b-base - Fine-tuning Method: LoRA
- Training Data: Custom Samba command dataset (5,726 samples)
- Language: English
- Intended Use: System administration, specifically generating Samba (
samba-tool) commands from text.
Files Provided
This repository contains two sets of model files:
- Merged Model (
deepseek-finetuned_merged/files): A complete, standalone model (~2.7GB). Ready for direct deployment and use. - LoRA Adapter (
deepseek-finetuned/files): Contains only the fine-tuned adapter weights (~250MB). Requires the base model and thepeftlibrary to run.
How to Get Started with the Model
You can load the model using the Hugging Face transformers library.
Option 1: Using the Merged Model (Recommended)
This is the easiest way to run the model, as it does not require loading separate adapters.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "OrhanDerin/Deepseek-SBX-finetuned"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "Instruction: Create a new user with username jodo and real name john doe\nOutput:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
command = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(command)
Option 2: Using the LoRA Adapter
If you prefer to load the base model and apply the LoRA weights manually:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model_id = "deepseek-ai/deepseek-coder-1.3b-base"
adapter_id = "OrhanDerin/Deepseek-SBX-finetuned"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(base_model_id)
# Load the LoRA adapter onto the base model
model = PeftModel.from_pretrained(base_model, adapter_id)
# Inference works the same as above
Training Details
Dataset
The model was trained on a JSON dataset containing 5,726 input-output pairs.
- Input: Natural language command description.
- Output: The exact corresponding Samba command.
Example data format:
{"input": "Create a new user with username jodo and real name john doe", "output": "sudo samba-tool user create jodo --given-name=John --surname=Doe"}
{"input": "enable user kcy", "output": "samba-tool user enable kcy"}
{"input": "get password fields of user kcy", "output": "samba-tool user getpassword kcy"}
Training Hyperparameters
The model was fine-tuned with the following LoRA and training configuration to optimize for 12GB+ VRAM environments:
LoRA Settings:
- Rank (r): 32
- Alpha: 64
- Dropout: 0.05
- Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj,lm_head - Trainable Parameters: ~21M (1.57% of total 1.34B parameters)
Training Parameters:
- Batch Size: 4 (per device)
- Gradient Accumulation: 4 steps (Effective batch size: 16)
- Learning Rate: 5e-4
- Epochs: 5
- Max Sequence Length: 768 tokens
- Precision: BFloat16
- Optimizer: AdamW with cosine scheduling
- Gradient Checkpointing: Enabled
Limitations & Security Notes
Security Warning
- AI-Generated Commands: The commands generated by this model are predictions and should not be executed automatically without human review.
- Destructive Actions: The model may output commands containing
sudo,rm -rf, or--force. Always verify the output before running it in a terminal.
Limitations
- Narrow Domain: This model is heavily specialized for Samba (
samba-tool) commands. It may hallucinate or perform poorly if asked to generate Python code, general Linux commands outside its training scope, or conversational text. - Prompt Sensitivity: The model responds best to direct, instructional prompts (e.g., "Instruction: [Task]\nOutput:"). Variations in formatting might yield degraded results.
- Downloads last month
- -
Model tree for OrhanDerin/Deepseek-SBX-finetuned
Base model
deepseek-ai/deepseek-coder-1.3b-base