Instructions to use neuralworm/gemma-3-270m-it-p2.8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use neuralworm/gemma-3-270m-it-p2.8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="neuralworm/gemma-3-270m-it-p2.8", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("neuralworm/gemma-3-270m-it-p2.8", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use neuralworm/gemma-3-270m-it-p2.8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "neuralworm/gemma-3-270m-it-p2.8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "neuralworm/gemma-3-270m-it-p2.8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/neuralworm/gemma-3-270m-it-p2.8
- SGLang
How to use neuralworm/gemma-3-270m-it-p2.8 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 "neuralworm/gemma-3-270m-it-p2.8" \ --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": "neuralworm/gemma-3-270m-it-p2.8", "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 "neuralworm/gemma-3-270m-it-p2.8" \ --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": "neuralworm/gemma-3-270m-it-p2.8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use neuralworm/gemma-3-270m-it-p2.8 with Docker Model Runner:
docker model run hf.co/neuralworm/gemma-3-270m-it-p2.8
Gemma-3 270M-IT-PX (Phase 2.8)
This is an experimental architectural modification of the Google Gemma-3 270M-IT base model. It implements the PX (Recursive Computational Headroom) architecture and Fluid Gaussian Cognitive Routing.
โ ๏ธ Transparency Notice
This is not a standard fine-tune. It is a structural mod that changes how the transformer processes tokens at inference time.
- Base Model: google/gemma-3-270m-it
- Modifications: Runtime patching of the forward pass to allow for recursive layer execution and dynamic cognitive routing.
๐ Key Innovations
1. Recursive Computational Headroom (PX)
Unlike standard transformers that pass through each layer once, Gemma-3-PX allows the model to "re-read" and "think" through specific layers multiple times. This effectively increases the depth of the model for complex tasks without adding new parameters.
2. Fluid Gaussian Cognitive Routing
The model dynamically analyzes the "cognitive signature" (Kurtosis) of each prompt during the prefill phase and automatically routes the task through a specific "Cognitive Envelope":
- Math Mode: Optimized for numerical precision.
- Logic Mode: Optimized for multi-step reasoning.
- Creative Mode: Optimized for semantic drift and metaphor.
- Synthesis Mode: Optimized for extraction and summarization.
๐ป Usage
To use this model, you must set trust_remote_code=True.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo_id = "neuralworm/gemma-3-270m-it-p2.8"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
prompt = "Sally has 3 brothers. Each brother has 2 sisters. How many sisters does Sally have?"
chat = [{"role": "user", "content": prompt}]
inputs = tokenizer(tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True), return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Developed by neuralworm (2026).