Text Generation
Transformers
Safetensors
English
gemma4
image-text-to-text
code
agent
grpo
reinforcement-learning
swe-bench
tree-of-reasoning
conversational
Instructions to use manojpanda/peta1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use manojpanda/peta1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="manojpanda/peta1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("manojpanda/peta1") model = AutoModelForMultimodalLM.from_pretrained("manojpanda/peta1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use manojpanda/peta1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "manojpanda/peta1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "manojpanda/peta1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/manojpanda/peta1
- SGLang
How to use manojpanda/peta1 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 "manojpanda/peta1" \ --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": "manojpanda/peta1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "manojpanda/peta1" \ --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": "manojpanda/peta1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use manojpanda/peta1 with Docker Model Runner:
docker model run hf.co/manojpanda/peta1
Peta1: Gemma 4 E4B Tree-of-Reasoning & Verifiable Outcome GRPO
Peta1 is an autonomous software engineering agent checkpoint based on google/gemma-4-E4B-it (4.3B active parameters), post-trained using a targeted three-stage curriculum:
- Tree-of-Reasoning (ToR) SFT: Supervised deliberation in Gemma 4's native latent thinking tokens (
<|channel|>thought) enforcing hypothesis formulation, environment simulation, and branch pruning. - Capability Frontier Discovery: Screening of candidate tasks (G = 4, T = 0.7) to isolate the 18% informative frontier band (0 < p < 1.0), preventing policy gradient collapse from trivial (36%) and impossible (46%) tasks.
- Verifiable Outcome GRPO: Policy gradient optimization with verifiable rewards (R_target + R_format + R_tor - lambda * length) and Group Relative Advantage estimation driven entirely on Dual Tesla T4 GPUs.
Benchmark Results
1. Full Official SWE-bench Lite (n = 300)
Evaluated on the full official test split of princeton-nlp/SWE-bench_Lite:
| Checkpoint | Solved / Total | Resolution Rate | 95% Wilson CI |
|---|---|---|---|
| Base Gemma 4 E4B | 25 / 300 | 8.33% | [5.71%, 12.01%] |
| Peta1 (Stage 3 ToR GRPO) | 101 / 300 | 33.67% | [28.56%, 39.19%] |
| Absolute Gain (Delta) | +76 tasks | +25.33pp | p = 5.23e-22 |
Paired Contingency Table (n = 300):
- Mutual Failure: 198
- Mutual Success: 24
- Solved ONLY by Peta1: 77 tasks
- Regressions (Solved ONLY by Base): 1 task
- Two-tailed exact McNemar test: chi^2 = 72.12, p = 5.23 × 10^-22.
2. The Navigation vs. Comprehension Dissociation
In a controlled 2-turn agentic evaluation across 20 repository tasks:
- Turn 1 (Autonomous Tool Navigation): Base Gemma 4 achieves 0.0% (0/20), while Peta1 achieves 25.0% (5/20) (+25.0pp gain).
- Turn 2 (Grounded Code Comprehension): When grounded file context is provided, both Base and Peta1 achieve 100.0% (20/20) resolution.
- This proves compact models possess strong latent code comprehension; post-training specifically cures exploration failure and tool navigation.
Quickstart
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "manojpanda/peta1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
messages = [
{"role": "user", "content": "Locate the bug in flask/wrappers.py where JSON decoding does not respect request encoding."}
]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=False))
Hardware & Training Details
- Hardware: 2x NVIDIA Tesla T4 (15 GiB VRAM each, Kaggle Free Tier)
- Precision: Full FP16 (zero quantization loss)
- Parameters: 4.3B active parameters
- License: Apache 2.0
- Downloads last month
- 511