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 Model Card with v2 official production release and benchmark audit
Browse files
README.md
CHANGED
|
@@ -1,86 +1,102 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: google/gemma-4-E2B-it
|
| 3 |
-
library_name: transformers
|
| 4 |
-
pipeline_tag: image-text-to-text
|
| 5 |
-
tags:
|
| 6 |
-
- gemma4
|
| 7 |
-
- spacecode
|
| 8 |
-
- react-native
|
| 9 |
-
- android
|
| 10 |
-
- mobile-development
|
| 11 |
-
- typescript
|
| 12 |
-
- python
|
| 13 |
-
- unsloth
|
| 14 |
-
- qlora
|
| 15 |
-
- gguf
|
| 16 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
language:
|
| 18 |
-
- pt
|
| 19 |
-
- en
|
|
|
|
| 20 |
---
|
| 21 |
|
| 22 |
-
# 🚀 SpaceCode-E2B (v2 —
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
**
|
| 25 |
-
|
| 26 |
-
- **Tema 2**: Configuração de Ambiente (`NVM`, `Node.js`, `NPM`/`Yarn`, `Android Studio`, `SDK`/`AVD`), `Expo CLI` vs `React Native CLI`, depuração (`ADB logcat`, `React Developer Tools`), `JSX`, transpilação, `Props`, `State` e Hooks (`useState`, `useEffect`).
|
| 27 |
-
- **Tema 3**: Interface Gráfica (`View`, `Text`, `Pressable`, `SafeAreaView`, `FlatList`, `SectionList`), estilização (`StyleSheet.create`, `Styled Components`, `Flexbox`), navegação (`@react-navigation/native`: *Stack*, *Tab*, *Drawer*) e animações (`Animated.timing`).
|
| 28 |
-
- **Tema 4**: Persistência de Dados Local e NoSQL (`AsyncStorage` com `JSON.stringify`/`JSON.parse`, `SQLite` transacional e `sqlite_sequence`, bancos orientados a objetos com `Realm` e documentos `MongoDB` / `Compass`).
|
| 29 |
-
- **Tema 5**: Conexão Remota (`Fetch API` nativa, `Axios` sobre `XMLHttpRequest` e `Response.data`), serviços `REST` (`GET`, `POST`, `PUT`, `DELETE`), protocolo `OAuth2` (4 papéis) e arquitetura *Offline First* (`react-native-offline`, `redux-offline`, *Optimistic UI*).
|
| 30 |
-
- **Tema 6**: Arquitetura de Software (`MVC` com camada `DAO`, `Flux` vs `Redux` sem *Dispatcher* via `createStore`/`Reducer`), criptografia (`CryptoJS` AES, `IV` aleatório com `CryptoJS.lib.WordArray.random(16)`, codificação `Base64`), testes unitários (`Jest` e `Mocks`), performance (`Hermes`, prevenção de *Memory Leak*) e publicação na Google Play (`APK` / `AAB` assinados).
|
| 31 |
-
- **Tema 7**: Resolução de estudos de caso e desafios reais de arquitetura mobile.
|
| 32 |
-
2. **Engenharia de Software Geral & Agentes**: Python, TypeScript, Rust, SQL, Segurança/OWASP, System Design e Debugging.
|
| 33 |
|
| 34 |
---
|
| 35 |
|
| 36 |
-
##
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
|
| 39 |
-
| :--- | :--- | :--- |
|
| 40 |
-
|
|
| 41 |
-
|
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
---
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
| **Tema 4** — Persistência (`AsyncStorage`, `SQLite`, `Realm`, `MongoDB`) | `8 / 8` | **100,0%** |
|
| 57 |
-
| **Tema 5** — Conexão Remota (`Fetch`, `Axios`, `REST`, `OAuth2`, `Offline First`) | `7 / 8` | **87,5%** |
|
| 58 |
-
| **Tema 6** — Tópicos Avançados (`MVC`/`DAO`, `Flux`/`Redux`, `CryptoJS`, `Jest`, `Hermes`) | `7 / 8` | **87,5%** |
|
| 59 |
-
| **Tema 7** — Desafios Práticos de Mercado Mobile (Estudos de Caso) | `10 / 10` | **100,0%** |
|
| 60 |
-
| **TOTAL GERAL (50 Questões — Temas 2 a 7)** | **`44 / 50`** | **`88,0%`** |
|
| 61 |
|
| 62 |
-
###
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
| **SCORE COMPOSTO PONDERADO FINAL** | **`100%`** | **Meta >= 85,0%** | **`95,20%` ✅** |
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
##
|
| 78 |
-
- **`v1` (Descartada antes do merge)**: Excelente memorização do formato de prova, porém apresentava *quiz-leakage* em perguntas abertas (transformava perguntas conceituais em questões de múltipla escolha) e regressão em código fora do domínio devido à falta de máscara de loss no prompt.
|
| 79 |
-
- **`v2` (Promovida — Baseline Oficial Validada Pedagogicamente)**:
|
| 80 |
-
- **Zero *quiz-leakage*** (`0/8` vazamentos em perguntas abertas e cenários de tutoria).
|
| 81 |
-
- **Forte capacidade de tutoria**: explica conceitos para iniciantes (como Redux e virtualização de listas), compara arquiteturas, escreve código funcional e resume aulas mantendo diversidade léxica (`4-gram >= 0.987`).
|
| 82 |
-
- **Domínio técnico validado pós-merge**: `88,0%` (`44/50`) no benchmark geral dos Temas 2–7, com `100%` em Persistência de Dados (Tema 4) e `100%` nos Desafios Práticos de Mercado (Tema 7).
|
| 83 |
|
| 84 |
-
|
| 85 |
-
1. **Pequena oscilação em questões objetivas após o merge 16-bit**: Na amostra inicial de 15 questões houve recuo de `13/15` (`86,7%` em `Base + LoRA v2`) para `12/15` (`80,0%` no `Merged 16-bit v2`), estabilizando em **`88,0%` (`44/50`)** no benchmark completo. Os poucos erros remanescentes concentram-se nos Temas 2 e 3 (`75,0%`).
|
| 86 |
-
2. **Desambiguação de contexto Android vs. React Native**: Em perguntas sobre comportamento de tela no Android (como barra de status / `SafeAreaView`) que não mencionam explicitamente *"React Native"* no prompt, o modelo pode exemplificar o código em Kotlin/Android nativo. Recomenda-se explicitar `"no React Native"` quando o foco for estritamente a disciplina.
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- google/gemma-4-E2B-it
|
| 5 |
+
tags:
|
| 6 |
+
- code
|
| 7 |
+
- vision
|
| 8 |
+
- multimodal
|
| 9 |
+
- gguf
|
| 10 |
+
- llama.cpp
|
| 11 |
+
- ollama
|
| 12 |
+
- unsloth
|
| 13 |
+
- software-engineering
|
| 14 |
+
- react-native
|
| 15 |
+
- android
|
| 16 |
+
- expo
|
| 17 |
+
- typescript
|
| 18 |
+
- python
|
| 19 |
language:
|
| 20 |
+
- pt
|
| 21 |
+
- en
|
| 22 |
+
pipeline_tag: image-text-to-text
|
| 23 |
---
|
| 24 |
|
| 25 |
+
# 🚀 SpaceCode-E2B (v2 — Release Oficial Homologado)
|
| 26 |
+
|
| 27 |
+
**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](https://github.com/unslothai/unsloth) pela **SpaceGhost**.
|
| 28 |
|
| 29 |
+
> **Status de Homologação**: ✅ **Aprovado para Produção Educacional (v2 Merged 16-bit)**
|
| 30 |
+
> **Benchmark Oficial (50 Questões Ementa Android/React Native)**: **44/50 (88.0%)** | **Score Composto**: **95.20%**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
---
|
| 33 |
|
| 34 |
+
## 📊 Métricas Oficiais do Benchmark (50 Questões)
|
| 35 |
+
|
| 36 |
+
Avaliação controlada sobre o currículo oficial de Desenvolvimento Mobile Android e React Native:
|
| 37 |
|
| 38 |
+
| Tema da Ementa | Tópicos Cobertos | Acurácia v2 Oficial | Status |
|
| 39 |
+
| :--- | :--- | :---: | :---: |
|
| 40 |
+
| **Tema 2** | Sintaxe JSX, Expo CLI vs Bare CLI, NPM/Yarn, Hooks básicos | **6/8 (75.0%)** | Aprovado |
|
| 41 |
+
| **Tema 3** | UI Nativa, FlatList, Flexbox, React Navigation, styled-components | **6/8 (75.0%)** | Aprovado |
|
| 42 |
+
| **Tema 4** | Persistência Local (AsyncStorage, SQLite, Realm, MongoDB) | **8/8 (100.0%)** | **Perfeito** |
|
| 43 |
+
| **Tema 5** | Conexão Remota (Fetch, Axios, OAuth2, Offline-First) | **7/8 (87.5%)** | Aprovado |
|
| 44 |
+
| **Tema 6** | Arquitetura MVC/DAO, Flux vs Redux, AES/CryptoJS, Jest, Google Play | **7/8 (87.5%)** | Aprovado |
|
| 45 |
+
| **Tema 7** | Desafios Integrados e Casos de Arquitetura | **10/10 (100.0%)** | **Perfeito** |
|
| 46 |
+
| **TOTAL GERAL** | **50 Questões Fechadas de Múltipla Escolha** | **44/50 (88.0%)** | **Homologado** |
|
| 47 |
|
| 48 |
---
|
| 49 |
|
| 50 |
+
## 📦 Estrutura e Governança de Artefatos
|
| 51 |
|
| 52 |
+
| Caminho no Repositório | Formato | Status | Descrição |
|
| 53 |
+
| :--- | :--- | :---: | :--- |
|
| 54 |
+
| `model.safetensors` (raiz) | **Safetensors (16-bit Merged)** | **Produção Oficial** | Modelo completo fundido (`v2 Merged`) para `transformers`, `vLLM` ou TGI |
|
| 55 |
+
| `Q4_K_M.gguf` (raiz) | **GGUF (`Q4_K_M`)** | **Produção Oficial** | Inferência rápida local com quantização de 4 bits para **Ollama** e **`llama.cpp`** |
|
| 56 |
+
| `lora/` | **QLoRA Adapter v2** | **Produção Oficial** | Pesos do adaptador validado com ~180 passos (`SpaceGhost/SpaceCode-E2B/lora`) |
|
| 57 |
+
| `lora_v4/` | **Micro-LoRA Corretivo** | **Ativo Experimental** | Adaptador corretivo com 82.0% de acurácia global e correção do Caso 3 (`styled-components`) |
|
| 58 |
+
| `lora_v3/` | **LoRA Pedagógico** | **Linha de Pesquisa** | Adaptador com estrutura explicativa detalhada de distratores de prova |
|
| 59 |
+
| `lora_master/` | **Checkpoint Unificado** | **Arquivado** | Baseline em estudo de expansão de dados heterogêneos |
|
| 60 |
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## 🚀 Como Executar
|
| 64 |
+
|
| 65 |
+
### 1. Via Ollama (GGUF `Q4_K_M`)
|
| 66 |
+
```bash
|
| 67 |
+
ollama run hf.co/SpaceGhost/SpaceCode-E2B:Q4_K_M
|
| 68 |
+
```
|
| 69 |
|
| 70 |
+
### 2. Via `llama.cpp`
|
| 71 |
+
```bash
|
| 72 |
+
llama-cli -hf SpaceGhost/SpaceCode-E2B:Q4_K_M --jinja
|
| 73 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
+
### 3. Via Unsloth / Transformers (Python)
|
| 76 |
+
```python
|
| 77 |
+
from unsloth import FastVisionModel
|
| 78 |
|
| 79 |
+
# Carregar versão de produção 16-bit da raiz:
|
| 80 |
+
model, processor = FastVisionModel.from_pretrained(
|
| 81 |
+
"SpaceGhost/SpaceCode-E2B",
|
| 82 |
+
load_in_4bit=True,
|
| 83 |
+
max_seq_length=2048,
|
| 84 |
+
)
|
| 85 |
+
```
|
|
|
|
| 86 |
|
| 87 |
---
|
| 88 |
|
| 89 |
+
## 🎯 Capacidades Homologadas
|
| 90 |
+
|
| 91 |
+
1. **Desenvolvimento Mobile Android (React Native & Expo)**:
|
| 92 |
+
- Resolução de dúvidas conceituais e arquiteturais cobrindo Temas 2 ao 7.
|
| 93 |
+
- 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.
|
| 94 |
+
2. **Engenharia de Software e Reparo Causal Multimodal**:
|
| 95 |
+
- Diagnóstico de falhas de renderização de interface visual (C08).
|
| 96 |
+
- Geração de patches em *Unified Diff* e código corretivo com restauração visual comprovada.
|
| 97 |
+
|
| 98 |
+
---
|
| 99 |
|
| 100 |
+
## ⚠️ Atribuição
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
+
- *SpaceCode-E2B is a fine-tuned derivative of Google Gemma 4 E2B (`google/gemma-4-E2B-it`).*
|
|
|
|
|
|