Stable Code Instruct 3B β€” Base Model

This repository stores an unchanged copy of stabilityai/stable-code-instruct-3b
for use as a base model in future fine‑tuning projects (including Stephen).


πŸ“Œ About the Model

stable-code-instruct-3b is a 2.7B parameter decoder-only transformer from Stability AI, tuned for multi‑language code generation and conversational coding assistance.
It is suitable as a starting point for specialized code assistants,
including fine‑tuned variants with domain‑specific datasets.

Key Features:

  • General purpose code generation across multiple programming languages.
  • Instruction‑tuned for better conversational performance.
  • Strong performance on MultiPL-E benchmarks.

πŸ“Š Performance (MultiPL-E Benchmark)

Language pass@1
Python 32.4%
C++ 30.9%
Java 32.1%
JavaScript 32.1%
PHP 24.2%
Rust 23.0%

πŸš€ Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "dgtalbug/stable-code-instruct-3b"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype=torch.bfloat16, trust_remote_code=True
).cuda().eval()

messages = [
    {"role": "system", "content": "You are a helpful coding assistant."},
    {"role": "user", "content": "Write a Python function to reverse a string."}
]

prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)

tokens = model.generate(
    **inputs,
    max_new_tokens=200,
    temperature=0.5,
    top_p=0.95,
    top_k=100,
    do_sample=True,
    use_cache=True
)

output = tokenizer.batch_decode(tokens[:, inputs.input_ids.shape[-1]:], skip_special_tokens=True)[0]
print(output)

πŸ“œ License

This model follows the Stability AI Community License.
For commercial use, refer to Stability AI licensing terms.


πŸ“Œ Note for Fine‑Tuning

This repository is not modified β€” it is kept as a clean base model for derivative works.
Fine‑tuned versions (e.g., Stephen) will be released in separate repositories.

Downloads last month
254
Safetensors
Model size
2.8B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results