Text Generation
GGUF
typescript
finetuned
spaceoutpl
unsloth
code
instruct
programming
gemma
lora
javascript
Instructions to use MassivDash/Gemma-4-tyepscript-coder-12b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use MassivDash/Gemma-4-tyepscript-coder-12b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MassivDash/Gemma-4-tyepscript-coder-12b", filename="gemma-4-12B.BF16-mmproj.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MassivDash/Gemma-4-tyepscript-coder-12b 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 MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M # Run inference directly in the terminal: llama cli -hf MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M # Run inference directly in the terminal: llama cli -hf MassivDash/Gemma-4-tyepscript-coder-12b: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 MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MassivDash/Gemma-4-tyepscript-coder-12b: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 MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
Use Docker
docker model run hf.co/MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use MassivDash/Gemma-4-tyepscript-coder-12b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MassivDash/Gemma-4-tyepscript-coder-12b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MassivDash/Gemma-4-tyepscript-coder-12b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
- Ollama
How to use MassivDash/Gemma-4-tyepscript-coder-12b with Ollama:
ollama run hf.co/MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
- Unsloth Studio
How to use MassivDash/Gemma-4-tyepscript-coder-12b 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 MassivDash/Gemma-4-tyepscript-coder-12b 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 MassivDash/Gemma-4-tyepscript-coder-12b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MassivDash/Gemma-4-tyepscript-coder-12b to start chatting
- Atomic Chat new
- Docker Model Runner
How to use MassivDash/Gemma-4-tyepscript-coder-12b with Docker Model Runner:
docker model run hf.co/MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
- Lemonade
How to use MassivDash/Gemma-4-tyepscript-coder-12b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MassivDash/Gemma-4-tyepscript-coder-12b:Q4_K_M
Run and chat with the model
lemonade run user.Gemma-4-tyepscript-coder-12b-Q4_K_M
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- mhhmm/typescript-instruct-20k
|
| 5 |
+
base_model:
|
| 6 |
+
- google/gemma-4-12B
|
| 7 |
+
tags:
|
| 8 |
+
- typescript
|
| 9 |
+
- finetuned
|
| 10 |
+
- spaceoutpl
|
| 11 |
+
- unsloth
|
| 12 |
+
- code
|
| 13 |
+
- text-generation
|
| 14 |
+
- instruct
|
| 15 |
+
- programming
|
| 16 |
+
- gemma
|
| 17 |
+
- lora
|
| 18 |
+
- javascript
|
| 19 |
---
|
| 20 |
+
|
| 21 |
+
# Gemma-4-12B TypeScript
|
| 22 |
+
|
| 23 |
+
This model is a specialized, fine-tuned version of [Google's Gemma-4 12B](https://huggingface.co/google/gemma-4-12B) designed specifically for TypeScript code generation, refactoring, and instruction. It was fine-tuned efficiently using the [Unsloth](https://github.com/unslothai/unsloth) library by [spaceoutpl].
|
| 24 |
+
|
| 25 |
+
## 💻 Model Details
|
| 26 |
+
|
| 27 |
+
* **Base Model:** google/gemma-4-12B
|
| 28 |
+
* **License:** MIT
|
| 29 |
+
* **Language:** English / TypeScript
|
| 30 |
+
* **Fine-tuning Framework:** Unsloth
|
| 31 |
+
* **Dataset:** [mhhmm/typescript-instruct-20k](https://huggingface.co/datasets/mhhmm/typescript-instruct-20k)
|
| 32 |
+
|
| 33 |
+
## 🚀 Intended Use
|
| 34 |
+
|
| 35 |
+
This model is ideal for developers and researchers looking for an AI assistant heavily specialized in the TypeScript ecosystem. Use cases include:
|
| 36 |
+
* **Code Generation:** Writing complex TypeScript functions, interfaces, and types.
|
| 37 |
+
* **Code Refactoring:** Converting standard JavaScript to strictly-typed TypeScript.
|
| 38 |
+
* **Instruction & Explanation:** Explaining TypeScript errors, generics, utility types, and best practices.
|
| 39 |
+
|
| 40 |
+
## 🛠️ Getting Started
|
| 41 |
+
|
| 42 |
+
You can load this model directly using the `transformers` library. Since it was trained with Unsloth, you can also utilize Unsloth's optimized inference engines for faster generation.
|
| 43 |
+
|
| 44 |
+
### Installation
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
pip install transformers torch accelerate
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
### Usage (Hugging Face Transformers)
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 54 |
+
import torch
|
| 55 |
+
|
| 56 |
+
model_id = "spaceoutpl/gemma-4-12B-typescript" # Update with your actual repo name
|
| 57 |
+
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 59 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 60 |
+
model_id,
|
| 61 |
+
device_map="auto",
|
| 62 |
+
torch_dtype=torch.bfloat16
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
prompt = "Write a generic TypeScript function to fetch and strictly type data from an API."
|
| 66 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 67 |
+
|
| 68 |
+
outputs = model.generate(**inputs, max_new_tokens=256)
|
| 69 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## 📊 Training Data
|
| 73 |
+
|
| 74 |
+
The model was fine-tuned on the `mhhmm/typescript-instruct-20k` dataset, which contains 20,000 high-quality instructional pairs focusing on TypeScript programming concepts, syntax, and problem-solving.
|
| 75 |
+
|
| 76 |
+
## ⚠️ Limitations & Biases
|
| 77 |
+
|
| 78 |
+
* **Hallucinations:** Like all LLMs, the model may occasionally generate plausible-looking but syntactically incorrect or non-compiling TypeScript code. Always test generated code in your environment.
|
| 79 |
+
* **Knowledge Cutoff:** The model's knowledge is limited to the training data of the base Gemma-4 model and the specific TypeScript dataset used for fine-tuning. It may not reflect the absolute latest TypeScript beta features.
|