Instructions to use SpaceGhost/SpaceCode-E2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SpaceGhost/SpaceCode-E2B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf SpaceGhost/SpaceCode-E2B:Q4_K_M # Run inference directly in the terminal: llama cli -hf SpaceGhost/SpaceCode-E2B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SpaceGhost/SpaceCode-E2B:Q4_K_M # Run inference directly in the terminal: llama cli -hf SpaceGhost/SpaceCode-E2B:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf SpaceGhost/SpaceCode-E2B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf SpaceGhost/SpaceCode-E2B:Q4_K_M
Use Docker
docker model run hf.co/SpaceGhost/SpaceCode-E2B:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use SpaceGhost/SpaceCode-E2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SpaceGhost/SpaceCode-E2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SpaceGhost/SpaceCode-E2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/SpaceGhost/SpaceCode-E2B:Q4_K_M
- Ollama
How to use SpaceGhost/SpaceCode-E2B with Ollama:
ollama run hf.co/SpaceGhost/SpaceCode-E2B:Q4_K_M
- Unsloth Desktop
- Pi
How to use SpaceGhost/SpaceCode-E2B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SpaceGhost/SpaceCode-E2B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "SpaceGhost/SpaceCode-E2B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use SpaceGhost/SpaceCode-E2B with Docker Model Runner:
docker model run hf.co/SpaceGhost/SpaceCode-E2B:Q4_K_M
- Lemonade
How to use SpaceGhost/SpaceCode-E2B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SpaceGhost/SpaceCode-E2B:Q4_K_M
Run and chat with the model
lemonade run user.SpaceCode-E2B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use SpaceGhost/SpaceCode-E2B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SpaceGhost/SpaceCode-E2B:Q4_K_M
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 SpaceGhost/SpaceCode-E2B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use SpaceGhost/SpaceCode-E2B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SpaceGhost/SpaceCode-E2B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "SpaceGhost/SpaceCode-E2B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
π SpaceCode-E2B (v2 β Release Oficial Homologado)
SpaceCode-E2B Γ© um modelo compacto de Engenharia de Software e Tutoria Educacional baseado no Google Gemma 4 E2B (google/gemma-4-E2B-it), ajustado via QLoRA SFT com Unsloth pela SpaceGhost.
Status de HomologaΓ§Γ£o: β Aprovado para ProduΓ§Γ£o Educacional (v2 Merged 16-bit)
Benchmark Oficial (50 QuestΓ΅es Ementa Android/React Native): 44/50 (88.0%) | Score Composto: 95.20%
π MΓ©tricas Oficiais do Benchmark (50 QuestΓ΅es)
AvaliaΓ§Γ£o controlada sobre o currΓculo oficial de Desenvolvimento Mobile Android e React Native:
| Tema da Ementa | TΓ³picos Cobertos | AcurΓ‘cia v2 Oficial | Status |
|---|---|---|---|
| Tema 2 | Sintaxe JSX, Expo CLI vs Bare CLI, NPM/Yarn, Hooks bΓ‘sicos | 6/8 (75.0%) | Aprovado |
| Tema 3 | UI Nativa, FlatList, Flexbox, React Navigation, styled-components | 6/8 (75.0%) | Aprovado |
| Tema 4 | PersistΓͺncia Local (AsyncStorage, SQLite, Realm, MongoDB) | 8/8 (100.0%) | Perfeito |
| Tema 5 | ConexΓ£o Remota (Fetch, Axios, OAuth2, Offline-First) | 7/8 (87.5%) | Aprovado |
| Tema 6 | Arquitetura MVC/DAO, Flux vs Redux, AES/CryptoJS, Jest, Google Play | 7/8 (87.5%) | Aprovado |
| Tema 7 | Desafios Integrados e Casos de Arquitetura | 10/10 (100.0%) | Perfeito |
| TOTAL GERAL | 50 QuestΓ΅es Fechadas de MΓΊltipla Escolha | 44/50 (88.0%) | Homologado |
π¦ Estrutura e GovernanΓ§a de Artefatos
| Caminho no RepositΓ³rio | Formato | Status | DescriΓ§Γ£o |
|---|---|---|---|
model.safetensors (raiz) |
Safetensors (16-bit Merged) | ProduΓ§Γ£o Oficial | Modelo completo fundido (v2 Merged) para transformers, vLLM ou TGI (Texto + VisΓ£o + Γudio) |
Q4_K_M.gguf (raiz) |
GGUF (Q4_K_M) |
ProduΓ§Γ£o Oficial | Pesos de linguagem quantizados em 4-bit para Ollama e llama.cpp |
mmproj-F16.gguf (raiz) |
GGUF Vision Projector (F16) | ProduΓ§Γ£o Oficial | Projetor multimodal (SigLIP/ViT) para leitura de imagens no Ollama e llama.cpp |
lora/ |
QLoRA Adapter v2 | ProduΓ§Γ£o Oficial | Pesos do adaptador validado com ~180 passos (SpaceGhost/SpaceCode-E2B/lora) |
lora_v4/ |
Micro-LoRA Corretivo | Ativo Experimental | Adaptador corretivo com 82.0% de acurΓ‘cia global e correΓ§Γ£o do Caso 3 (styled-components) |
lora_v3/ |
LoRA PedagΓ³gico | Linha de Pesquisa | Adaptador com estrutura explicativa detalhada de distratores de prova |
lora_master/ |
Checkpoint Unificado | Arquivado | Baseline em estudo de expansΓ£o de dados heterogΓͺneos |
π Como Executar
1. Via Ollama (Multimodal com Imagens + Texto)
O repositΓ³rio jΓ‘ inclui o Modelfile prΓ©-configurado com ligaΓ§Γ£o nativa ao mmproj-F16.gguf:
# Baixar arquivos e registrar o modelo no Ollama:
ollama create spacecode -f Modelfile
# Executar com prompt de texto ou anΓ‘lise de imagem:
ollama run spacecode "Analise esta tela de UI: /caminho/para/imagem.png"
2. Via llama.cpp (Texto + VisΓ£o)
# InferΓͺncia multimodal com suporte a imagem:
llama-cli -m Q4_K_M.gguf --mmproj mmproj-F16.gguf --image /caminho/para/imagem.png -p "<|turn>user\nExplique o problema nesta UI e mostre o cΓ³digo React Native correto.<turn|>\n<|turn>model\n"
3. Via Transformers (Multimodal Python Oficial)
from transformers import AutoProcessor, AutoModelForMultimodalLM
MODEL_ID = "SpaceGhost/SpaceCode-E2B"
# Carregar processador e modelo multimodal completo
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
MODEL_ID,
torch_dtype="auto",
device_map="auto"
)
# Processar texto e imagem:
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://example.com/screenshot.png"},
{"type": "text", "text": "Analise a tela e crie o componente React Native correspondente."}
]
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
π― Capacidades Homologadas
- Desenvolvimento Mobile Android (React Native & Expo):
- ResoluΓ§Γ£o de dΓΊvidas conceituais e arquiteturais cobrindo Temas 2 ao 7.
- DiagnΓ³stico estΓ‘tico de cΓ³digo, verificaΓ§Γ£o de dependΓͺncias de hooks (
useEffect), importaΓ§Γ£o correta de mΓ³dulos nativos e contratos assΓncronos.
- Engenharia de Software e Reparo Causal Multimodal:
- DiagnΓ³stico de falhas de renderizaΓ§Γ£o de interface visual (C08).
- GeraΓ§Γ£o de patches em Unified Diff e cΓ³digo corretivo com restauraΓ§Γ£o visual comprovada.
β οΈ AtribuiΓ§Γ£o
- SpaceCode-E2B is a fine-tuned derivative of Google Gemma 4 E2B (
google/gemma-4-E2B-it).
- Downloads last month
- -