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: Mark SpaceCode-E2B v2 as first pedagogically validated release (88% 50-MCQ, 95.20% composite score)
Browse files
README.md
CHANGED
|
@@ -1,79 +1,86 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
- python
|
| 18 |
-
- rust
|
| 19 |
-
- go
|
| 20 |
language:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
pipeline_tag: image-text-to-text
|
| 24 |
---
|
| 25 |
|
| 26 |
-
# SpaceCode-E2B
|
| 27 |
|
| 28 |
-
**SpaceCode-E2B** é um modelo de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
---
|
| 31 |
|
| 32 |
-
## 📦
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
| Caminho no Repositório | Formato | Finalidade |
|
| 37 |
| :--- | :--- | :--- |
|
| 38 |
-
| `
|
| 39 |
-
| `
|
| 40 |
-
| `lora/` |
|
| 41 |
|
| 42 |
---
|
| 43 |
|
| 44 |
-
##
|
| 45 |
|
| 46 |
-
|
| 47 |
-
```bash
|
| 48 |
-
ollama run hf.co/SpaceGhost/SpaceCode-E2B:Q4_K_M
|
| 49 |
-
```
|
| 50 |
|
| 51 |
-
###
|
| 52 |
-
```bash
|
| 53 |
-
llama-cli -hf SpaceGhost/SpaceCode-E2B:Q4_K_M --jinja
|
| 54 |
-
```
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
#
|
| 61 |
-
model, processor = FastVisionModel.from_pretrained("SpaceGhost/SpaceCode-E2B", load_in_4bit=True)
|
| 62 |
-
```
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
- Suporte a **TypeScript, Python, Dart/Flutter, SQL, Java, Go, C#, Rust e Bash**.
|
| 73 |
-
- 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.
|
| 74 |
|
| 75 |
---
|
| 76 |
|
| 77 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
|
|
|
|
|
|
|
|
|
| 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 — Primeira Versão Validada Pedagogicamente)
|
| 23 |
|
| 24 |
+
**`SpaceGhost/SpaceCode-E2B`** é um modelo multimodal compacto de engenharia de software e tutoria educacional baseado no **`google/gemma-4-E2B-it`**, especializado em:
|
| 25 |
+
1. **Desenvolvimento Mobile Android com React Native & Expo**:
|
| 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 |
+
## 📦 Artefatos Unificados neste Repositório
|
| 37 |
|
| 38 |
+
| Caminho | Formato | Descrição |
|
|
|
|
|
|
|
| 39 |
| :--- | :--- | :--- |
|
| 40 |
+
| `model.safetensors` (raiz) | `bfloat16` (16-bit Merged) | Modelo completo fundido (`Merged 16-bit v2`) pronto para `transformers` / `vLLM` |
|
| 41 |
+
| `Q4_K_M.gguf` (raiz) | `GGUF Q4_K_M` | Versão quantizada para execução local em CPU/GPU via `Ollama` / `llama.cpp` |
|
| 42 |
+
| `lora/` | `PEFT LoRA Adapter` | Adaptador QLoRA `v2` (`r=16, alpha=16`) isolado |
|
| 43 |
|
| 44 |
---
|
| 45 |
|
| 46 |
+
## 📊 Validação Técnica e Pedagógica (`v2` — Aprovado para Produção Educacional)
|
| 47 |
|
| 48 |
+
O treinamento da **`v2`** foi conduzido em GPU **NVIDIA L4 (24 GB VRAM, `bfloat16`)** aplicando **mascaramento estrito de loss apenas na resposta (`labels = -100` nos tokens do usuário)**, separação rigorosa entre conteúdo teórico/código e exercícios objetivos, regularização (`lora_dropout=0.05`, `weight_decay=0.05`, `lr=1.2e-4`) e replay de programação geral.
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
### 1. Benchmark Expandido de 50 Questões por Tema (`Merged 16-bit v2`)
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
| Tema / Escopo | Acertos | Acurácia |
|
| 53 |
+
| :--- | :---: | :---: |
|
| 54 |
+
| **Tema 2** — Sintaxe, Ambiente, CLI/Expo, ADB, JSX, Props/State | `6 / 8` | **75,0%** |
|
| 55 |
+
| **Tema 3** — Interface Gráfica, Listas (`FlatList`/`SectionList`), Navegação, `Animated` | `6 / 8` | **75,0%** |
|
| 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 |
+
### 2. Score Composto Ponderado Final (`Merged 16-bit v2`)
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
| Eixo de Avaliação | Peso | Resultado Medido | Contribuição |
|
| 65 |
+
| :--- | :---: | :---: | :---: |
|
| 66 |
+
| **1. Exercícios dos Temas 2–7 (50 questões)** | `40%` | **88,0%** (`44/50`) | `35,20%` |
|
| 67 |
+
| **2. Tutoria Educacional (5 cenários reais de estudo)** | `30%` | **100,0%** (`5/5` aprovados) | `30,00%` |
|
| 68 |
+
| **3. Seguimento de Instruções Inéditas (Tabela 3 linhas + Resumo 5 tópicos)** | `15%` | **100,0%** (`2/2` aprovados) | `15,00%` |
|
| 69 |
+
| **4. Ausência de *Quiz-Leakage* em Perguntas Abertas** | `10%` | **100,0%** (`0/8` vazamentos) | `10,00%` |
|
| 70 |
+
| **5. Não-Regressão em Programação Geral (Python)** | `5%` | **100,0%** (`1/1` funcional) | `5,00%` |
|
| 71 |
+
| **SCORE COMPOSTO PONDERADO FINAL** | **`100%`** | **Meta >= 85,0%** | **`95,20%` ✅** |
|
|
|
|
|
|
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
+
## 📝 Changelog & Observações da Versão (`v2`)
|
| 76 |
+
|
| 77 |
+
### Evolução `v1` $
|
| 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 |
+
### Limitações Conhecidas & Pontos de Atenção
|
| 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.
|