Text Generation
Transformers
Safetensors
English
gemma
code
reasoning
codegemma
safe-tensors
distillation
synthetic-dataset
text-generation-inference
Instructions to use WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled") model = AutoModelForCausalLM.from_pretrained("WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled
- SGLang
How to use WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled 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 "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled with Docker Model Runner:
docker model run hf.co/WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled
| license: apache-2.0 | |
| tags: | |
| - text-generation | |
| - code | |
| - reasoning | |
| - codegemma | |
| - gemma | |
| - safe-tensors | |
| - distillation | |
| - synthetic-dataset | |
| base_model: google/codegemma-1.1-2b | |
| datasets: | |
| - WithinUsAI/GeminiPro3.2_max_distill_god_seed_25k | |
| - WithinUsAI/gemini_3.5_flash_distilled_25k | |
| - WithinUsAI/Gemini_3.2_Pro_Distilled | |
| - WithinUsAI/codegemma_gemini_pro_32_distilled_25k | |
| - WithinUsAI/DEEPMIND_Alpha_Distilled | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| language: | |
| - en | |
| # Gemini3.5-Code.Reasoner-2b-Distilled | |
| Gemini3.5-Code.Reasoner-2b-Distilled is a highly efficient, reasoning-dense model tailored for advanced coding tasks, algorithmic problem-solving, and logical chain-of-thought workflows. | |
| By applying a specialized Low-Rank Adaptation (LoRA) layer over **CodeGemma 1.1 2B**, this model infuses frontier-level reasoning mechanics into a compact, 2-billion parameter architecture. It bridges the gap between massive cloud-hosted models and local, edge-compute hardware. | |
| ## Model Details | |
| - **Developed by:** WithinUsAI | |
| - **Model Type:** Causal Language Model (Fine-tuned / Knowledge Distilled) | |
| - **Base Model:** [google/codegemma-1.1-2b](https://huggingface.co/google/codegemma-1.1-2b) | |
| - **Architecture:** GemmaForCausalLM (CodeGemma variant) + LoRA Adapters | |
| - **License:** Apache 2.0 | |
| ## Training & Dataset Recipe | |
| The "Reasoner" capabilities of this model are distilled from a multi-source synthetic pipeline focusing on complex coding logic, algorithmic optimization, and step-by-step thinking patterns. The training mixture leverages approximately 100K+ high-quality reasoning examples across five core datasets: | |
| | Dataset Name | Source / Focus | Approx. Size | | |
| | :--- | :--- | :--- | | |
| | `WithinUsAI/GeminiPro3.2_max_distill_god_seed_25k` | High-quality frontier seed prompts for code generation. | ~25k samples | | |
| | `WithinUsAI/gemini_3.5_flash_distilled_25k` | Fast, iterative logical steps and multi-turn debugging data. | ~25k samples | | |
| | `WithinUsAI/Gemini_3.2_Pro_Distilled` | Heavy math logic, structural coding, and system design patterns. | Premium corpus | | |
| | `WithinUsAI/codegemma_gemini_pro_32_distilled_25k` | Target-aligned distillation data optimized for the CodeGemma vocabulary. | ~25k samples | | |
| | `WithinUsAI/DEEPMIND_Alpha_Distilled` | Deep algorithmic competitive programming and math reasoning. | Premium corpus | | |
| ## Intended Use | |
| - **Local Code Assistants:** Ideal for IDE plugins requiring fast, low-latency code completion and instruction following. | |
| - **Logical Chain-of-Thought:** Designed to output its reasoning process before writing the final code block, minimizing syntax and logical errors. | |
| - **Resource-Constrained Environments:** Can easily be deployed on mobile devices, single-GPU setups, or local laptops using frameworks like `vLLM`, `Ollama`, or `SGLang`. | |
| ## Quickstart Guide | |
| ### Inference with Hugging Face Transformers | |
| Because CodeGemma utilizes specialized tokens for coding workflows, it's recommended to structure your prompts cleanly to prompt the model's inner chain-of-thought. | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| import torch | |
| model_id = "WithinUsAI/Gemini3.5-Code.Reasoner-2b-Distilled" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto" | |
| ) | |
| # Prompt the model to think step-by-step before delivering code | |
| prompt = """<bos>Analyze the problem and think step-by-step before writing any code. | |
| Problem: Write a Python generator function that yields the Fibonacci sequence up to n elements. | |
| Answer:""" | |
| inputs = tokenizer(prompt, return_tensors="pt").to("cuda") | |
| outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |