Code Reasoning
Collection
7 items • Updated • 5
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 "GetSoloTech/Gemma3-Code-Reasoning-4B" \
--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": "GetSoloTech/Gemma3-Code-Reasoning-4B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'A finetuned version of google/gemma-3-4b-it specifically optimized for competitive programming and code reasoning tasks. This model has been trained on the high-quality Code-Reasoning dataset to enhance its capabilities in solving complex programming problems with detailed reasoning.
This model is a LoRA-finetuned version of gemma-3-4b-it with the following specifications:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "GetSoloTech/Gemma3-Code-Reasoning-4B"
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# Prepare input for competitive programming problem
messages = [
{"role": "system", "content": "You are an expert competitive programmer. Read the problem and produce a correct, efficient solution. Include reasoning if helpful."},
{"role": "user", "content": "Your programming problem here..."}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Generate solution
generated_ids = model.generate(
**model_inputs,
max_new_tokens=4096,
temperature=1.0,
top_p=0.95,
top_k=64
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
content = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
print(content)
This finetuned model is expected to show improved performance on:
This model was created using the Unsloth framework and the Code-Reasoning dataset. For questions about:
For questions about this finetuned model, please open an issue in the repository.
Note: This model is specifically optimized for competitive programming and code reasoning tasks.
Base model
google/gemma-3-4b-pt
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "GetSoloTech/Gemma3-Code-Reasoning-4B" \ --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": "GetSoloTech/Gemma3-Code-Reasoning-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'