Instructions to use rachelteoh1/scpi-llama-3.2-1b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rachelteoh1/scpi-llama-3.2-1b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rachelteoh1/scpi-llama-3.2-1b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rachelteoh1/scpi-llama-3.2-1b-instruct") model = AutoModelForCausalLM.from_pretrained("rachelteoh1/scpi-llama-3.2-1b-instruct", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rachelteoh1/scpi-llama-3.2-1b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rachelteoh1/scpi-llama-3.2-1b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rachelteoh1/scpi-llama-3.2-1b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rachelteoh1/scpi-llama-3.2-1b-instruct
- SGLang
How to use rachelteoh1/scpi-llama-3.2-1b-instruct 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 "rachelteoh1/scpi-llama-3.2-1b-instruct" \ --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": "rachelteoh1/scpi-llama-3.2-1b-instruct", "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 "rachelteoh1/scpi-llama-3.2-1b-instruct" \ --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": "rachelteoh1/scpi-llama-3.2-1b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rachelteoh1/scpi-llama-3.2-1b-instruct with Docker Model Runner:
docker model run hf.co/rachelteoh1/scpi-llama-3.2-1b-instruct
- Model Card for Model ID
- Model Details
- Uses
- Bias, Risks, and Limitations
- How to Get Started with the Model
- Training Details
- Evaluation
- Model Examination [optional]
- Environmental Impact
- Technical Specifications [optional]
- Citation [optional]
- Glossary [optional]
- More Information [optional]
- Model Card Authors [optional]
- Model Card Contact
- Model Details
Model Card for Model ID
This model is a fine-tuned version of Meta’s LLaMA 3.2 1B-Instruct specialized for optimizing SCPI (Standard Commands for Programmable Instruments) command sequences. It takes raw SCPI sequences as input and outputs an optimized version of the sequence along with an explanation of the optimization.
Model Details
Base Model Architecture: LLaMA 3.2 1B Instruct Provider: Meta Language: English Framework: Transformers, PEFT (LoRA) Precision: 4-bit (BitsAndBytes NF4 quantization)
Adapter / Fine-Tuning Info Adapter type: LoRA (Low-Rank Adaptation) Training objective: Optimize SCPI command sequences and explain improvements. Dataset: Custom SCPI dataset (train.jsonl and test.jsonl) containing command pairs (raw → optimized) with explanations. Training setup: Mixed-precision (4-bit NF4 quantization) Optimizer: AdamW 8bit Framework: Transformers + PEFT Evaluation metrics: Loss, Perplexity, BLEU, ROUGE
Uses
Optimize and explain SCPI command sequences for Keysight-style instruments or other devices using SCPI protocol.
Bias, Risks, and Limitations
- The model is trained only on SCPI command sequences from Keysight and English explanations. It cannot generalize to other domains or scripting languages.
- It expects well-formed SCPI commands; malformed or incomplete commands may yield irrelevant or verbose responses.
- Quantization (4-bit) can slightly reduce precision in floating-point computations, which may cause subtle output variations between runs.
- The model may include redundant or unnecessary commands if the context deviates from typical instrument-control patterns.
Recommendations
Always review optimized SCPI sequences manually before execution.
How to Get Started with the Model
Use the code below to get started with the model.
Training Details
Training Data
- Dataset Name: Custom SCPI Optimization Dataset
- Format: JSONL
- Structure: Each record contains an input SCPI command sequence, the optimized version, and a natural-language explanation.
- Size: ~1,500 data samples
- Split Ratio: 90 % training / 10 % testing
Evaluation
| Metric | Value |
|---|---|
| BLEU | 94.68 |
| ROUGE-1 | 0.9753 |
| ROUGE-2 | 0.9734 |
| ROUGE-L | 0.9745 |
| Test Loss | 3.6224 |
| Perplexity | 37.43 |
Testing Data, Factors & Metrics
Testing Data
Held-out test split from the same SCPI dataset (test.jsonl), never seen during training.
Metrics
| Metric | Description |
|---|---|
| BLEU | Measures token-level overlap between generated and reference optimized SCPI sequences. |
| ROUGE-1/2/L | Measures recall-based similarity for unigrams, bigrams, and longest common subsequence. |
| Loss | Cross-entropy loss over token predictions. |
| Perplexity (PPL) | Exponential of loss; indicates overall model confidence and fluency. |
Results
[More Information Needed]
Summary
The fine-tuned LLaMA-3.2-1B-Instruct model demonstrates excellent alignment between its generated SCPI command optimizations and reference human annotations. High BLEU (94.68) and ROUGE (≈0.97) scores indicate strong lexical and structural similarity to the ground-truth optimized command sequences.
Moderate loss (3.62) and perplexity (37.43) are expected for structured symbolic text (SCPI commands), where even small token deviations can inflate numeric metrics despite correct semantic meaning.
The model consistently: Inserts missing initialization commands like *RST. Re-orders dependent operations for valid execution order. Adds relevant scpi commands which are missing during generation. Removes redundant or conflicting SCPI calls. Provides short, accurate explanations of optimizations.
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [More Information Needed]
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]
- Downloads last month
- 4