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 README with multimodal mmproj and vision execution instructions
Browse files
README.md
CHANGED
|
@@ -51,8 +51,9 @@ Avaliação controlada sobre o currículo oficial de Desenvolvimento Mobile Andr
|
|
| 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** |
|
|
|
|
| 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 |
|
|
@@ -62,26 +63,58 @@ Avaliação controlada sobre o currículo oficial de Desenvolvimento Mobile Andr
|
|
| 62 |
|
| 63 |
## 🚀 Como Executar
|
| 64 |
|
| 65 |
-
### 1. Via Ollama (
|
|
|
|
| 66 |
```bash
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
```
|
| 69 |
|
| 70 |
-
### 2. Via `llama.cpp`
|
| 71 |
```bash
|
| 72 |
-
|
|
|
|
| 73 |
```
|
| 74 |
|
| 75 |
-
### 3. Via
|
| 76 |
```python
|
| 77 |
-
from
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
# Carregar
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
| 84 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
```
|
| 86 |
|
| 87 |
---
|
|
|
|
| 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 (Texto + Visão + Áudio) |
|
| 55 |
+
| `Q4_K_M.gguf` (raiz) | **GGUF (`Q4_K_M`)** | **Produção Oficial** | Pesos de linguagem quantizados em 4-bit para **Ollama** e **`llama.cpp`** |
|
| 56 |
+
| `mmproj-F16.gguf` (raiz) | **GGUF Vision Projector (F16)** | **Produção Oficial** | Projetor multimodal (SigLIP/ViT) para leitura de imagens no **Ollama** e **`llama.cpp`** |
|
| 57 |
| `lora/` | **QLoRA Adapter v2** | **Produção Oficial** | Pesos do adaptador validado com ~180 passos (`SpaceGhost/SpaceCode-E2B/lora`) |
|
| 58 |
| `lora_v4/` | **Micro-LoRA Corretivo** | **Ativo Experimental** | Adaptador corretivo com 82.0% de acurácia global e correção do Caso 3 (`styled-components`) |
|
| 59 |
| `lora_v3/` | **LoRA Pedagógico** | **Linha de Pesquisa** | Adaptador com estrutura explicativa detalhada de distratores de prova |
|
|
|
|
| 63 |
|
| 64 |
## 🚀 Como Executar
|
| 65 |
|
| 66 |
+
### 1. Via Ollama (Multimodal com Imagens + Texto)
|
| 67 |
+
O repositório já inclui o `Modelfile` pré-configurado com ligação nativa ao `mmproj-F16.gguf`:
|
| 68 |
```bash
|
| 69 |
+
# Baixar arquivos e registrar o modelo no Ollama:
|
| 70 |
+
ollama create spacecode -f Modelfile
|
| 71 |
+
|
| 72 |
+
# Executar com prompt de texto ou análise de imagem:
|
| 73 |
+
ollama run spacecode "Analise esta tela de UI: /caminho/para/imagem.png"
|
| 74 |
```
|
| 75 |
|
| 76 |
+
### 2. Via `llama.cpp` (Texto + Visão)
|
| 77 |
```bash
|
| 78 |
+
# Inferência multimodal com suporte a imagem:
|
| 79 |
+
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"
|
| 80 |
```
|
| 81 |
|
| 82 |
+
### 3. Via Transformers (Multimodal Python Oficial)
|
| 83 |
```python
|
| 84 |
+
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 85 |
+
|
| 86 |
+
MODEL_ID = "SpaceGhost/SpaceCode-E2B"
|
| 87 |
|
| 88 |
+
# Carregar processador e modelo multimodal completo
|
| 89 |
+
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
| 90 |
+
model = AutoModelForMultimodalLM.from_pretrained(
|
| 91 |
+
MODEL_ID,
|
| 92 |
+
torch_dtype="auto",
|
| 93 |
+
device_map="auto"
|
| 94 |
)
|
| 95 |
+
|
| 96 |
+
# Processar texto e imagem:
|
| 97 |
+
messages = [
|
| 98 |
+
{
|
| 99 |
+
"role": "user",
|
| 100 |
+
"content": [
|
| 101 |
+
{"type": "image", "url": "https://example.com/screenshot.png"},
|
| 102 |
+
{"type": "text", "text": "Analise a tela e crie o componente React Native correspondente."}
|
| 103 |
+
]
|
| 104 |
+
}
|
| 105 |
+
]
|
| 106 |
+
|
| 107 |
+
inputs = processor.apply_chat_template(
|
| 108 |
+
messages,
|
| 109 |
+
tokenize=True,
|
| 110 |
+
return_dict=True,
|
| 111 |
+
return_tensors="pt",
|
| 112 |
+
add_generation_prompt=True,
|
| 113 |
+
).to(model.device)
|
| 114 |
+
|
| 115 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 116 |
+
response = processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
|
| 117 |
+
print(response)
|
| 118 |
```
|
| 119 |
|
| 120 |
---
|