Image-Text-to-Text
Safetensors
GGUF
Portuguese
English
gemma4
code
vision
multimodal
software-engineering
react-native
android
typescript
python
unsloth
conversational
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"
docs: update public Model Card
Browse files
README.md
CHANGED
|
@@ -2,9 +2,6 @@
|
|
| 2 |
license: gemma
|
| 3 |
base_model:
|
| 4 |
- google/gemma-4-E2B-it
|
| 5 |
-
- unsloth/gemma-4-E2B-it
|
| 6 |
-
datasets:
|
| 7 |
-
- SpaceGhost/space-dataset
|
| 8 |
tags:
|
| 9 |
- code
|
| 10 |
- vision
|
|
@@ -13,7 +10,7 @@ tags:
|
|
| 13 |
- llama.cpp
|
| 14 |
- ollama
|
| 15 |
- unsloth
|
| 16 |
-
-
|
| 17 |
- react
|
| 18 |
- flutter
|
| 19 |
- typescript
|
|
@@ -26,94 +23,56 @@ language:
|
|
| 26 |
pipeline_tag: image-text-to-text
|
| 27 |
---
|
| 28 |
|
| 29 |
-
# SpaceCode-E2B-it
|
| 30 |
|
| 31 |
-
**SpaceCode-E2B-it** é um modelo de Engenharia de Software e Reparo Visual
|
| 32 |
|
| 33 |
---
|
| 34 |
|
| 35 |
-
## 📌 Visão Geral
|
| 36 |
|
| 37 |
-
- **
|
| 38 |
-
- **
|
| 39 |
-
- **
|
| 40 |
-
- **
|
| 41 |
-
- **Formato / Quantização**: `GGUF` (`gemma-4-E2B-it.Q4_K_M.gguf`) + `Modelfile` oficial para Ollama
|
| 42 |
-
- **Janela de Contexto**: 128K tokens (treinado com `max_seq_length=4096`)
|
| 43 |
|
| 44 |
---
|
| 45 |
|
| 46 |
-
##
|
| 47 |
-
|
| 48 |
-
O modelo foi ajustado sobre o corpus **`train_131.jsonl`** (SHA-256: `f4382467afa2a41e832c01d79489fdb17e9c561e6b5ec26545bdc937a74c1009`), combinando reparo visual causal e engenharia de software políglota com **zero vazamento (0% data leakage)** contra os conjuntos de validação, holdout de teste e benchmark de ambiguidade:
|
| 49 |
-
|
| 50 |
-
1. **C08 — Diagnóstico Causal e Reparo Visual Dual-Image (31 exemplos)**:
|
| 51 |
-
- Pares multimodais (`expected_ui` vs. `actual_ui` + código quebrado) cobrindo regressões de CSS/Tailwind e Flutter (`flex_direction`, `grid_columns`, `overflow_clipping`, `padding_collapse`, `gap_collapse`, `z_index_occlusion`, `color_contrast`, `alignment_shift`).
|
| 52 |
-
- Saída estruturada em 3 blocos auditáveis:
|
| 53 |
-
1. `### 1. Diagnóstico Causal da Regressão Visual`
|
| 54 |
-
2. `### 2. Patch Mínimo (Unified Diff)`
|
| 55 |
-
3. `### 3. Código Corrigido Completo`
|
| 56 |
-
2. **Engenharia de Software Políglota C01–C06 (100 exemplos em 9 linguagens)**:
|
| 57 |
-
- **Linguagens**: TypeScript (28), Python (22), Dart/Flutter (11), SQL (10), Java (9), Go (8), C# (5), Rust (5) e Bash (2).
|
| 58 |
-
- **Categorias**:
|
| 59 |
-
- `C01`: Correção de Bug com Causa Raiz + Teste Unitário (23)
|
| 60 |
-
- `C02`: Refatoração Estrutural / Clean Architecture (16)
|
| 61 |
-
- `C03`: Geração de Testes Unitários e Edge Cases (15)
|
| 62 |
-
- `C04`: Code Review Técnico e Segurança / OWASP (15)
|
| 63 |
-
- `C05`: Raciocínio Arquitetural e Trade-offs / ADR (16)
|
| 64 |
-
- `C06`: Implementação Idiomática End-to-End (15)
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
| **Hardware** | 1x NVIDIA L4 (23 GB VRAM, CUDA 13.0, `bfloat16`) |
|
| 73 |
-
| **Método de Fine-Tuning** | QLoRA 4-bit (`r=16`, `lora_alpha=16`, `lora_dropout=0`) |
|
| 74 |
-
| **Parâmetros Treináveis** | `36,925,440` de `5,160,103,456` (`0.72%`) |
|
| 75 |
-
| **Épocas / Steps Totais** | `3.0` épocas (`99` steps de otimização) |
|
| 76 |
-
| **Batch Efetivo** | `4` (`per_device_train_batch_size=1`, `gradient_accumulation_steps=4`) |
|
| 77 |
-
| **Learning Rate / Scheduler** | `2e-4` (`cosine`, `warmup_ratio=0.05`, `adamw_8bit`) |
|
| 78 |
-
| **Training Loss Inicial $\rightarrow$ Final** | `2.3800` (step 1) $\rightarrow$ `0.4500–0.9045` (época 3) |
|
| 79 |
-
| **Training Loss Médio Global** | **`0.97316`** |
|
| 80 |
-
| **Tempo Total de Treino** | `822.52s` (~13m42s) |
|
| 81 |
|
| 82 |
---
|
| 83 |
|
| 84 |
-
## 🚀 Como Executar
|
| 85 |
|
| 86 |
-
###
|
| 87 |
```bash
|
| 88 |
ollama run hf.co/SpaceGhost/SpaceCode-E2B-it
|
| 89 |
```
|
| 90 |
|
| 91 |
-
###
|
| 92 |
```bash
|
| 93 |
llama-cli -hf SpaceGhost/SpaceCode-E2B-it --jinja
|
| 94 |
```
|
| 95 |
|
| 96 |
-
### 3. Arquivos Disponíveis no Repositório
|
| 97 |
-
- `gemma-4-E2B-it.Q4_K_M.gguf` — Pesos quantizados em 4-bit (`Q4_K_M`)
|
| 98 |
-
- `Modelfile` — Configuração pronta para importação no Ollama
|
| 99 |
-
- `config.json` — Metadados de arquitetura Gemma 4 E2B
|
| 100 |
-
|
| 101 |
-
> **Nota sobre Multimodalidade em GGUF**: O arquivo `.gguf` exportado contém o backbone de texto quantizado (`Q4_K_M`) para inferência rápida de código, diagnóstico textual, refatoração e arquitetura em CPU/GPU local. Para inferência com entrada direta de imagens (visão nativa Dual-Image C08), utilize o adaptador QLoRA com `Unsloth` / `Transformers` (`FastVisionModel`).
|
| 102 |
-
|
| 103 |
---
|
| 104 |
|
| 105 |
-
## 🧭
|
| 106 |
|
| 107 |
-
| Repositório
|
| 108 |
| :--- | :--- | :--- |
|
| 109 |
-
| [`SpaceGhost/SpaceCode`](https://huggingface.co/SpaceGhost/SpaceCode) | **
|
| 110 |
-
| [`SpaceGhost/SpaceCode-Merged`](https://huggingface.co/SpaceGhost/SpaceCode-Merged) | **
|
| 111 |
-
| [`SpaceGhost/SpaceCode
|
| 112 |
-
| [`SpaceGhost/space-dataset`](https://huggingface.co/datasets/SpaceGhost/space-dataset) | **Dataset Oficial Auditado** (`train_131.jsonl`, `manifest_131.json`, splits C07/C08) | `c6306f4a` |
|
| 113 |
|
| 114 |
---
|
| 115 |
|
| 116 |
-
## ⚠️
|
| 117 |
|
| 118 |
- *SpaceCode-E2B-it is a fine-tuned derivative of Google Gemma 4 E2B (`google/gemma-4-E2B-it`).*
|
| 119 |
-
- Desenvolvido pela organização **SpaceGhost** no contexto do projeto `dataset-treina` (sem relação com o benchmark acadêmico independente `KurtDu/SpaceCode-Bench`).
|
|
|
|
| 2 |
license: gemma
|
| 3 |
base_model:
|
| 4 |
- google/gemma-4-E2B-it
|
|
|
|
|
|
|
|
|
|
| 5 |
tags:
|
| 6 |
- code
|
| 7 |
- vision
|
|
|
|
| 10 |
- llama.cpp
|
| 11 |
- ollama
|
| 12 |
- unsloth
|
| 13 |
+
- software-engineering
|
| 14 |
- react
|
| 15 |
- flutter
|
| 16 |
- typescript
|
|
|
|
| 23 |
pipeline_tag: image-text-to-text
|
| 24 |
---
|
| 25 |
|
| 26 |
+
# SpaceCode-E2B-it
|
| 27 |
|
| 28 |
+
**SpaceCode-E2B-it** é um modelo de Engenharia de Software e Reparo Visual de Interfaces derivado do **Google Gemma 4 E2B (`google/gemma-4-E2B-it`)**, ajustado via QLoRA SFT com [Unsloth](https://github.com/unslothai/unsloth) pela **SpaceGhost**.
|
| 29 |
|
| 30 |
---
|
| 31 |
|
| 32 |
+
## 📌 Visão Geral
|
| 33 |
|
| 34 |
+
- **Modelo Base**: `google/gemma-4-E2B-it`
|
| 35 |
+
- **Arquitetura**: Multimodal (Visão + Texto) e Geração de Código
|
| 36 |
+
- **Janela de Contexto**: 128K tokens
|
| 37 |
+
- **Método de Ajuste**: QLoRA 4-bit SFT
|
|
|
|
|
|
|
| 38 |
|
| 39 |
---
|
| 40 |
|
| 41 |
+
## 🎯 Capacidades Principais
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
1. **Diagnóstico e Reparo de Interfaces (UI/UX & Frontend/Mobile)**:
|
| 44 |
+
- Identificação de regressões visuais e problemas de layout em **React / TypeScript / Tailwind CSS** e **Flutter / Dart**.
|
| 45 |
+
- Geração de diagnósticos de causa raiz, patches em formato *Unified Diff* e código corrigido.
|
| 46 |
+
2. **Engenharia de Software Políglota**:
|
| 47 |
+
- Suporte a **TypeScript, Python, Dart/Flutter, SQL, Java, Go, C#, Rust e Bash**.
|
| 48 |
+
- Correção de bugs com análise de causa raiz, refatoração estrutural, geração de testes unitários, revisão de código (segurança e boas práticas) e decisões de arquitetura.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
---
|
| 51 |
|
| 52 |
+
## 🚀 Como Executar
|
| 53 |
|
| 54 |
+
### Via Ollama
|
| 55 |
```bash
|
| 56 |
ollama run hf.co/SpaceGhost/SpaceCode-E2B-it
|
| 57 |
```
|
| 58 |
|
| 59 |
+
### Via `llama.cpp`
|
| 60 |
```bash
|
| 61 |
llama-cli -hf SpaceGhost/SpaceCode-E2B-it --jinja
|
| 62 |
```
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
---
|
| 65 |
|
| 66 |
+
## 🧭 Variantes Oficiais
|
| 67 |
|
| 68 |
+
| Repositório | Formato | Uso Recomendado |
|
| 69 |
| :--- | :--- | :--- |
|
| 70 |
+
| [`SpaceGhost/SpaceCode-E2B-it`](https://huggingface.co/SpaceGhost/SpaceCode-E2B-it) | **GGUF (`Q4_K_M`)** | Inferência rápida local via Ollama e `llama.cpp` |
|
| 71 |
+
| [`SpaceGhost/SpaceCode-Merged`](https://huggingface.co/SpaceGhost/SpaceCode-Merged) | **Safetensors (16-bit)** | Inferência multimodal completa (Visão + Texto) via Transformers / vLLM |
|
| 72 |
+
| [`SpaceGhost/SpaceCode`](https://huggingface.co/SpaceGhost/SpaceCode) | **QLoRA Adapter** | Inferência leve com PEFT / Unsloth e continuidade de fine-tuning |
|
|
|
|
| 73 |
|
| 74 |
---
|
| 75 |
|
| 76 |
+
## ⚠️ Atribuição
|
| 77 |
|
| 78 |
- *SpaceCode-E2B-it is a fine-tuned derivative of Google Gemma 4 E2B (`google/gemma-4-E2B-it`).*
|
|
|