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
Gemma-4-12B TypeScript
This model is a specialized, fine-tuned version of Google's Gemma-4 12B designed specifically for TypeScript code generation, refactoring, and instruction. It was fine-tuned efficiently using the Unsloth library by [spaceoutpl].
๐ป Model Details
- Base Model: google/gemma-4-12B
- License: MIT
- Language: English / TypeScript
- Fine-tuning Framework: Unsloth
- Dataset: mhhmm/typescript-instruct-20k
๐ Intended Use
This model is ideal for developers and researchers looking for an AI assistant heavily specialized in the TypeScript ecosystem. Use cases include:
- Code Generation: Writing complex TypeScript functions, interfaces, and types.
- Code Refactoring: Converting standard JavaScript to strictly-typed TypeScript.
- Instruction & Explanation: Explaining TypeScript errors, generics, utility types, and best practices.
๐ ๏ธ Getting Started
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.
Installation
pip install transformers torch accelerate
Usage (Hugging Face Transformers)
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "spaceoutpl/gemma-4-12B-typescript" # Update with your actual repo name
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16
)
prompt = "Write a generic TypeScript function to fetch and strictly type data from an API."
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
๐ Training Data
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.
โ ๏ธ Limitations & Biases
- 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.
- 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.
- Downloads last month
- -
4-bit
5-bit
6-bit
8-bit
16-bit
Model tree for MassivDash/Gemma-4-tyepscript-coder-12b
Base model
google/gemma-4-12B