Instructions to use sylvester-francis/typescript-slm-1.5b-full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sylvester-francis/typescript-slm-1.5b-full with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sylvester-francis/typescript-slm-1.5b-full") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sylvester-francis/typescript-slm-1.5b-full") model = AutoModelForCausalLM.from_pretrained("sylvester-francis/typescript-slm-1.5b-full") 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]:])) - llama-cpp-python
How to use sylvester-francis/typescript-slm-1.5b-full with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sylvester-francis/typescript-slm-1.5b-full", filename="gguf/typescript-slm-1.5b-q4_k_m.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sylvester-francis/typescript-slm-1.5b-full with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M # Run inference directly in the terminal: llama cli -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M # Run inference directly in the terminal: llama cli -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Use Docker
docker model run hf.co/sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use sylvester-francis/typescript-slm-1.5b-full with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sylvester-francis/typescript-slm-1.5b-full" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sylvester-francis/typescript-slm-1.5b-full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
- SGLang
How to use sylvester-francis/typescript-slm-1.5b-full 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 "sylvester-francis/typescript-slm-1.5b-full" \ --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": "sylvester-francis/typescript-slm-1.5b-full", "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 "sylvester-francis/typescript-slm-1.5b-full" \ --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": "sylvester-francis/typescript-slm-1.5b-full", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use sylvester-francis/typescript-slm-1.5b-full with Ollama:
ollama run hf.co/sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
- Unsloth Studio
How to use sylvester-francis/typescript-slm-1.5b-full with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sylvester-francis/typescript-slm-1.5b-full to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sylvester-francis/typescript-slm-1.5b-full to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sylvester-francis/typescript-slm-1.5b-full to start chatting
- Pi
How to use sylvester-francis/typescript-slm-1.5b-full with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "sylvester-francis/typescript-slm-1.5b-full:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use sylvester-francis/typescript-slm-1.5b-full with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use sylvester-francis/typescript-slm-1.5b-full with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "sylvester-francis/typescript-slm-1.5b-full:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use sylvester-francis/typescript-slm-1.5b-full with Docker Model Runner:
docker model run hf.co/sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
- Lemonade
How to use sylvester-francis/typescript-slm-1.5b-full with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sylvester-francis/typescript-slm-1.5b-full:Q4_K_M
Run and chat with the model
lemonade run user.typescript-slm-1.5b-full-Q4_K_M
List all available models
lemonade list
TypeScript-SLM-1.5B-Full
TypeScript-SLM-1.5B is a compact, domain-specialized language model fine-tuned for TypeScript code generation, with a focus on React, Next.js, Angular, and Node.js frameworks.
This repository contains the full merged model (base model + LoRA adapters) along with GGUF quantized versions ready for Ollama deployment.
Model Description
- Base Model: Qwen/Qwen2.5-Coder-1.5B-Instruct
- Model Type: Causal Language Model (Code Generation)
- Parameters: 1.5 billion
- Context Length: 1024 tokens
- Fine-tuning Method: LoRA (Low-Rank Adaptation)
- License: MIT
- Language: English (Code: TypeScript/JavaScript)
Key Features
- ✅ Specialized in TypeScript code generation
- ✅ Framework-aware (React, Next.js, Angular, Node.js)
- ✅ Strongly-typed code with proper interfaces and types
- ✅ Optimized for modern web development patterns
- ✅ Available in multiple GGUF quantizations for Ollama
- ✅ Fast inference on consumer hardware
Intended Uses
Primary Use Cases
- TypeScript Code Completion: Auto-complete TypeScript code in IDEs
- Component Generation: Create React/Angular components from descriptions
- Type Definition: Generate TypeScript interfaces and type aliases
- Code Snippets: Quick generation of framework-specific patterns
- Learning Aid: Study TypeScript and framework best practices
Example Prompts
// React component with TypeScript
"Create a React component with TypeScript for a user profile card"
// Next.js API route
"Write a Next.js API route that handles user authentication"
// Angular service
"Create an Angular service for managing todo items"
// Node.js Express server
"Write an Express server with TypeScript that includes CORS and error handling"
// Type definitions
"Define a TypeScript interface for a blog post with author information"
How to Use
Option 1: Ollama (Recommended for Local Use)
The easiest way to use this model locally is with Ollama:
# Import the model using the Modelfile
ollama create typescript-slm-1.5b -f Modelfile-q4_k_m
# Run the model
ollama run typescript-slm-1.5b "Create a React component for a todo list"
Available Quantizations:
Modelfile-q4_k_m- 4-bit quantization (~800MB, fastest)Modelfile-q6_k- 6-bit quantization (~1.2GB, balanced)Modelfile-f16- 16-bit float (~3GB, highest quality)
Option 2: Transformers (Python)
Use directly with the Transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model and tokenizer
model_name = "sylvester-francis/typescript-slm-1.5b-full"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Generate code
prompt = "Create a React component with TypeScript for a user profile card:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.3,
top_p=0.95,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
code = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(code)
Option 3: GGUF Files (llama.cpp)
Download GGUF files directly for use with llama.cpp:
# Download specific quantization
huggingface-cli download sylvester-francis/typescript-slm-1.5b-full \
gguf/typescript-slm-1.5b-q4_k_m.gguf --local-dir ./models
# Run with llama.cpp
./llama-cli -m ./models/gguf/typescript-slm-1.5b-q4_k_m.gguf \
-p "Create a TypeScript interface for a user profile"
Model Details
Architecture
- Base: Qwen2.5-Coder-1.5B-Instruct
- Modifications: LoRA fine-tuning on TypeScript-specific data
- LoRA Rank: 64
- LoRA Alpha: 128
- Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Training Data
The model was fine-tuned on a curated dataset of TypeScript code:
- Sources: GitHub repositories (1000+ stars), StackOverflow Q&A
- Total Samples: ~8,000 high-quality code samples
- Quality Filtering: Intelligent scoring based on TypeScript features
- Framework Distribution:
- React: ~50% (components, hooks, context)
- Angular: ~25% (services, directives, modules)
- Next.js: ~15% (pages, API routes, SSR)
- Node.js: ~10% (Express, NestJS, APIs)
Quality Indicators:
- Proper TypeScript type annotations
- Complete modules with imports/exports
- Framework-specific best practices
- Production-quality code from popular repositories
Training Configuration
Base Model: Qwen/Qwen2.5-Coder-1.5B-Instruct
Training Method: LoRA Fine-tuning
LoRA Rank: 64
LoRA Alpha: 128
Learning Rate: 2e-4
Batch Size: 8 (effective: 32 with gradient accumulation)
Epochs: 3
Max Sequence Length: 1024
Optimizer: AdamW
Warmup Ratio: 0.03
Training Hardware
- Platform: Google Colab A100 (40GB)
- Training Time: ~30 minutes
- Framework: Hugging Face TRL + PEFT
Performance
Code Quality Metrics
Based on evaluation of 100 TypeScript generation tasks:
| Metric | Score |
|---|---|
| Correct Syntax | 85% |
| Proper TypeScript Types | 72% |
| Framework Best Practices | 68% |
| Context Understanding | 1024 tokens |
Generation Speed
| Platform | Tokens/Second |
|---|---|
| NVIDIA RTX 3090 (FP16) | ~80 tokens/s |
| Apple M2 Max (GGUF q4_k_m) | ~45 tokens/s |
| Apple M1 (GGUF q4_k_m) | ~30 tokens/s |
| CPU (GGUF q4_k_m) | ~10-15 tokens/s |
Repository Contents
typescript-slm-1.5b-full/
├── config.json # Model configuration
├── tokenizer.json # Tokenizer configuration
├── tokenizer_config.json # Tokenizer settings
├── generation_config.json # Generation parameters
├── pytorch_model.bin # Full merged PyTorch model
├── model.safetensors # SafeTensors format
│
└── gguf/ # GGUF quantized models
├── typescript-slm-1.5b-q4_k_m.gguf # 4-bit quantization (~800MB)
├── typescript-slm-1.5b-q6_k.gguf # 6-bit quantization (~1.2GB)
├── typescript-slm-1.5b-f16.gguf # 16-bit float (~3GB)
├── Modelfile-q4_k_m # Ollama config (4-bit)
├── Modelfile-q6_k # Ollama config (6-bit)
└── Modelfile-f16 # Ollama config (16-bit)
Quantization Comparison
| Format | Size | Quality | Speed | Use Case |
|---|---|---|---|---|
| q4_k_m | ~800MB | Good | Fastest | Local development, quick iteration |
| q6_k | ~1.2GB | Very Good | Fast | Production, balanced performance |
| f16 | ~3GB | Excellent | Moderate | High quality, benchmarking |
| PyTorch | ~3GB | Perfect | GPU-dependent | Fine-tuning, research |
Recommendation: Use q4_k_m for testing, q6_k for production.
Limitations
Known Limitations
- Context Length: Limited to 1024 tokens (larger contexts may lose coherence)
- Complex Logic: May struggle with very complex algorithmic tasks
- Newer Frameworks: Limited knowledge of frameworks released after training cutoff
- Type Inference: Sometimes requires explicit type annotations
- Edge Cases: May not handle all TypeScript edge cases correctly
Not Recommended For
- ❌ Production-critical code without review
- ❌ Security-sensitive implementations
- ❌ Complex algorithm design
- ❌ Large-scale refactoring
- ❌ Framework versions beyond training data
Best Used With
- ✅ Human review and validation
- ✅ Existing codebase context
- ✅ Clear, specific prompts
- ✅ Common framework patterns
- ✅ Learning and prototyping
Ethical Considerations
Intended Use
This model is designed for:
- Developer productivity: Assisting professional developers
- Learning: Helping students learn TypeScript and frameworks
- Prototyping: Quick generation of boilerplate code
Potential Risks
- Code Quality: Generated code should always be reviewed
- Security: May generate insecure patterns if prompted
- Licensing: Generated code may resemble training data patterns
- Bias: May reflect patterns common in open-source code
Responsible Use Guidelines
- Always Review: Never deploy generated code without review
- Test Thoroughly: All generated code should be tested
- Check Licenses: Ensure compliance with relevant licenses
- Security Audit: Review for security vulnerabilities
- Attribution: Credit the model when appropriate
Related Models
Model Family
- typescript-slm-1.5b - LoRA adapter only
- typescript-slm-7b - Larger 7B variant
- typescript-slm-7b-reasoning - 7B with enhanced reasoning
Comparison
| Model | Parameters | Context | Speed | Quality | Use Case |
|---|---|---|---|---|---|
| 1.5B | 1.5B | 1024 | Fastest | Good | Local dev, quick iteration |
| 7B | 7B | 2048 | Fast | Excellent | Production code |
| 7B-Reasoning | 7B | 2048 | Moderate | Excellent+ | Complex problems, debugging |
Training Pipeline
This model was created using the TypeScript SLM training pipeline:
# Train your own model
git clone https://github.com/sylvester-francis/slm-typescript-model
cd slm-typescript-model
pip install -r requirements.txt
# Run complete pipeline
python slm.py pipeline
# Deploy to Ollama
python slm.py deploy typescript-slm-1.5b
Citation
If you use this model in your research or project, please cite:
@software{typescript_slm_1.5b_2025,
author = {Francis, Sylvester},
title = {TypeScript-SLM-1.5B: Domain-Specialized Language Model for TypeScript},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/sylvester-francis/typescript-slm-1.5b-full}
}
Acknowledgments
- Base Model: Qwen2.5-Coder-1.5B-Instruct by Alibaba Cloud
- Training Framework: Hugging Face TRL and PEFT
- GGUF Conversion: llama.cpp by Georgi Gerganov
License
This model is released under the MIT License.
MIT License
Copyright (c) 2025 Sylvester Francis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Contact & Support
- Issues: https://github.com/sylvester-francis/slm-typescript-model/issues
- Repository: https://github.com/sylvester-francis/slm-typescript-model
- HuggingFace: https://huggingface.co/sylvester-francis
Version History
- v1.0.0 (2025-11-29): Initial release
- Full merged model with LoRA adapters
- GGUF quantizations (q4_k_m, q6_k, f16)
- Ollama Modelfiles
- Optimized for React, Next.js, Angular, Node.js
Keywords: typescript, react, nextjs, angular, nodejs, code-generation, llm, gguf, ollama, qwen, lora, small-language-model
- Downloads last month
- 129
Model tree for sylvester-francis/typescript-slm-1.5b-full
Base model
Qwen/Qwen2.5-1.5B