Instructions to use midnigter/CryptoGemma-4B-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use midnigter/CryptoGemma-4B-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="midnigter/CryptoGemma-4B-v1") 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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("midnigter/CryptoGemma-4B-v1") model = AutoModelForImageTextToText.from_pretrained("midnigter/CryptoGemma-4B-v1") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - MLX
How to use midnigter/CryptoGemma-4B-v1 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("midnigter/CryptoGemma-4B-v1") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- vLLM
How to use midnigter/CryptoGemma-4B-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "midnigter/CryptoGemma-4B-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "midnigter/CryptoGemma-4B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/midnigter/CryptoGemma-4B-v1
- SGLang
How to use midnigter/CryptoGemma-4B-v1 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 "midnigter/CryptoGemma-4B-v1" \ --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": "midnigter/CryptoGemma-4B-v1", "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 "midnigter/CryptoGemma-4B-v1" \ --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": "midnigter/CryptoGemma-4B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi new
How to use midnigter/CryptoGemma-4B-v1 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "midnigter/CryptoGemma-4B-v1"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "midnigter/CryptoGemma-4B-v1" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use midnigter/CryptoGemma-4B-v1 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "midnigter/CryptoGemma-4B-v1"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default midnigter/CryptoGemma-4B-v1
Run Hermes
hermes
- MLX LM
How to use midnigter/CryptoGemma-4B-v1 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "midnigter/CryptoGemma-4B-v1"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "midnigter/CryptoGemma-4B-v1" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "midnigter/CryptoGemma-4B-v1", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use midnigter/CryptoGemma-4B-v1 with Docker Model Runner:
docker model run hf.co/midnigter/CryptoGemma-4B-v1
CryptoGemma-4B-v1
The first open-source crypto-specialized LLM. Fine-tuned from Google's Gemma 4 E4B on 56,000+ crypto-specific examples.
What is CryptoGemma?
CryptoGemma is a 4B parameter language model specialized for cryptocurrency and blockchain analysis. Built by SkillForge, it understands:
- Token analysis — fundamental and on-chain metrics
- Scam detection — smart contract risk assessment
- Portfolio advice — allocation and rebalancing strategies
- Technical analysis — chart patterns, indicators, market structure
- DeFi protocols — liquidity, yield farming, lending
- Blockchain security — audit patterns, vulnerability detection
- Market sentiment — social signals, fear & greed analysis
Training Details
| Parameter | Value |
|---|---|
| Base model | google/gemma-4-E4B-it (4B params) |
| Dataset size | 56,612 examples |
| Method | LoRA (8 layers) |
| Iterations | 500 |
| Learning rate | 1e-5 |
| Train loss | 0.120 |
| Validation loss | 0.153 |
| Training time | ~1.5 hours on Mac Studio M2 Ultra |
| Framework | mlx-lm |
Dataset Composition
| Source | Examples |
|---|---|
| Cogneo Crypto Sentiment | 43,027 |
| Forta Malicious Contracts | 12,000 |
| HuggingFace open datasets (Bitcoin, smart contracts, blockchain) | 3,267 |
| ChainGPT-generated Q&A (16 categories) | ~300 |
| Total (after dedup) | 56,612 |
Usage
With Ollama
# Download and run
ollama run cryptogemma
# Example
>>> Analyze Bitcoin's current market structure and key support levels
With Transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("SkillForge/CryptoGemma-4B-v1")
tokenizer = AutoTokenizer.from_pretrained("SkillForge/CryptoGemma-4B-v1")
prompt = "Analyze the risk factors of this DeFi protocol..."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
With MLX (Apple Silicon)
from mlx_lm import load, generate
model, tokenizer = load("SkillForge/CryptoGemma-4B-v1")
response = generate(model, tokenizer, prompt="What are the key metrics for evaluating a DeFi token?", max_tokens=512)
Skills
CryptoGemma powers 4 ready-to-use skills:
- Token Analyzer — ticker to full breakdown
- Scam Detector — contract address to risk score
- Portfolio Advisor — positions to recommendations
- TA Generator — trading pair to technical analysis
Links
- Website: skill-forge.space
- Telegram Bot: @CryptoGemma_bot
- Twitter: @SkillForgeSOL
License
Apache 2.0 (same as base Gemma model)
Citation
@misc{cryptogemma2026,
title={CryptoGemma-4B-v1: Open-Source Crypto-Specialized LLM},
author={SkillForge Team},
year={2026},
url={https://huggingface.co/SkillForge/CryptoGemma-4B-v1}
}
- Downloads last month
- 226
Quantized