Instructions to use AMFORGE/samg-cobratooling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AMFORGE/samg-cobratooling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AMFORGE/samg-cobratooling")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AMFORGE/samg-cobratooling", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AMFORGE/samg-cobratooling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AMFORGE/samg-cobratooling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMFORGE/samg-cobratooling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AMFORGE/samg-cobratooling
- SGLang
How to use AMFORGE/samg-cobratooling 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 "AMFORGE/samg-cobratooling" \ --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": "AMFORGE/samg-cobratooling", "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 "AMFORGE/samg-cobratooling" \ --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": "AMFORGE/samg-cobratooling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AMFORGE/samg-cobratooling with Docker Model Runner:
docker model run hf.co/AMFORGE/samg-cobratooling
Forward pass reference β model.py needed for NumPy inference
Hi AMFORGE team,
I'm running SAM-G-CobraTooling in pure NumPy (no PyTorch) on an Android
device. The tokenizer, weights, and config all load correctly, but the
forward pass always produces the SAME output regardless of input.
Tested inputs that give near-identical output:
- "[CHAT] hi"
- "[CHAT] what is a mutex"
- "[ACTION] open src/main.js and run the tests"
This suggests either the attention is collapsing or the diversity module
plays a critical role we're not reproducing.
Tried:
- Causal mask on/off
- QKV split [q,k,v] and interleaved
- Positional embeddings 0/1-based, forward and reversed
- Block order 0β7 and 7β0
- Diversity: off / pares / todos / final
- BOS token on/off
- Repetition penalty 1.0 to 2.0
All produce the same "theX" token pattern.
Could you share the reference model.py (forward pass only is enough)?
The README documents the input format but not the attention/norm details.
Thanks!
Hi, thanks for the detailed report β clearly a lot of real work went into this.
We can't share the reference model.py β the implementation is proprietary. The published weights assume the exact forward pass they were trained with, so a from-scratch reimplementation will diverge in ways that are hard to debug blind.
That said, we're interested in what you're building β running it on Android is exactly the kind of edge use case we care about. If you'd like to dig deeper, reach us at contact@ameforge.tech and we can look at it together.