Instructions to use guifav/caramelo-gemma4-e4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use guifav/caramelo-gemma4-e4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="guifav/caramelo-gemma4-e4b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("guifav/caramelo-gemma4-e4b") model = AutoModelForMultimodalLM.from_pretrained("guifav/caramelo-gemma4-e4b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use guifav/caramelo-gemma4-e4b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="guifav/caramelo-gemma4-e4b", filename="caramelo-4.4.1-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use guifav/caramelo-gemma4-e4b 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 guifav/caramelo-gemma4-e4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf guifav/caramelo-gemma4-e4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf guifav/caramelo-gemma4-e4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf guifav/caramelo-gemma4-e4b:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf guifav/caramelo-gemma4-e4b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf guifav/caramelo-gemma4-e4b:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf guifav/caramelo-gemma4-e4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf guifav/caramelo-gemma4-e4b:Q4_K_M
Use Docker
docker model run hf.co/guifav/caramelo-gemma4-e4b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use guifav/caramelo-gemma4-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "guifav/caramelo-gemma4-e4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "guifav/caramelo-gemma4-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/guifav/caramelo-gemma4-e4b:Q4_K_M
- SGLang
How to use guifav/caramelo-gemma4-e4b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "guifav/caramelo-gemma4-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "guifav/caramelo-gemma4-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "guifav/caramelo-gemma4-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "guifav/caramelo-gemma4-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use guifav/caramelo-gemma4-e4b with Ollama:
ollama run hf.co/guifav/caramelo-gemma4-e4b:Q4_K_M
- Unsloth Studio
How to use guifav/caramelo-gemma4-e4b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for guifav/caramelo-gemma4-e4b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for guifav/caramelo-gemma4-e4b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for guifav/caramelo-gemma4-e4b to start chatting
- Pi
How to use guifav/caramelo-gemma4-e4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf guifav/caramelo-gemma4-e4b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "guifav/caramelo-gemma4-e4b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use guifav/caramelo-gemma4-e4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf guifav/caramelo-gemma4-e4b: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 guifav/caramelo-gemma4-e4b:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use guifav/caramelo-gemma4-e4b with Docker Model Runner:
docker model run hf.co/guifav/caramelo-gemma4-e4b:Q4_K_M
- Lemonade
How to use guifav/caramelo-gemma4-e4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull guifav/caramelo-gemma4-e4b:Q4_K_M
Run and chat with the model
lemonade run user.caramelo-gemma4-e4b-Q4_K_M
List all available models
lemonade list
Caramelo 4.4.1
Modelo de IA brasileiro treinado por Guilherme Favaron sobre modelos open source. Esta versão usa como base o google/gemma-4-E4B-it (Gemma 4 E4B, Apache-2.0) e aplica um fine-tune LoRA que treina síntese e comunicação na voz de escrita do autor: resposta direta em português do Brasil, argumento com dado e exemplo, sem hype e sem emoji.
A premissa do projeto: a forma de comunicar é parte da performance. Nos testes cegos abaixo, o fine-tune vence o próprio modelo base em qualidade, além do estilo. No ciclo em que o raciocínio bruto foi medido (3.4.2, 1.432 questões do ENEM), ele ficou no nível do base.
Em produção em ia-caramelo.com desde julho de 2026, servindo API compatível com a OpenAI, app web e CLI (caramelo-chat no npm). Gratuito, com limites de uso.
Como foi treinado
- Base:
google/gemma-4-E4B-it@fee6332c(revision pinada;training_config.jsonregistra o snapshot completo de hiperparâmetros, versões e revisions) - Dataset:
guifav/caramelo-dataset, 414 pares de correção de estilo (o mesmo dataset e a mesma receita do ciclo anterior, documentados no relatório técnico) - Método: QLoRA 4-bit (r=16, alpha=32, dropout 0.05, 3 épocas, LR 2e-4), adapter de 34,9M parâmetros (0,44% do modelo); loss de treino 2,53 → 1,33
- Publicação: adapter em
guifav/caramelo-gemma4-e4b-lora-adapter; este repo contém o merge em bf16 e o GGUFQ4_K_Musado em produção - Script:
finetune/gemma4_e4b/train_lora.pyno repositório do projeto
A arquitetura base Gemma4ForConditionalGeneration é multimodal (any-to-any: texto, imagem e áudio), mas o Caramelo opera apenas em texto: o LoRA é anexado só no decoder textual (model.language_model.layers.*) e as pernas de vision/audio ficam congeladas. Por isso o pipeline_tag é text-generation.
Avaliação (A/B cego, 2 juízes LLM independentes)
Nos 24 prompts held-out do benchmark do projeto:
| Comparação | Estilo | Qualidade |
|---|---|---|
| vs. Gemma 4 E4B base (sem fine-tune) | 100% | 95–100% |
| vs. caramelo 3.4.2 (versão anterior, Gemma 3 4B) | 79–87% | 87–91% |
O 4.4.1 escreve respostas mais completas que o 3.4.2 (~400 vs ~270 tokens em média); no julgamento cego, os juízes apontaram que a versão anterior omitia conteúdo relevante com mais frequência.
Esses números sustentam a premissa: treinar comunicação melhora a performance medida da tarefa. No ciclo anterior (3.4.2), o raciocínio bruto foi medido em 1.432 questões do ENEM e ficou no nível do base (57,5% vs 57,2%), enquanto a qualidade julgada às cegas venceu o base em 66–70%.
Produção
Servido em CPU (llama.cpp, GGUF Q4_K_M, 5,0 GiB) a ~18,5 tokens/s em 4 vCPUs. O chat template do Gemma 4 liga thinking por padrão; em produção o servidor roda com --reasoning off. A persona e a camada de segurança são injetadas server-side pelo gateway e têm prioridade sobre instruções do usuário.
Licença
O modelo base google/gemma-4-E4B-it é distribuído sob Apache-2.0; este fine-tune segue os mesmos termos. O dataset guifav/caramelo-dataset é de propriedade de Guilherme Favaron. Confirme a licença vigente na página do modelo base antes de redistribuir.
Segurança
A camada de segurança do Caramelo em produção é aplicada server-side pelo gateway em ia-caramelo.com. Estes pesos não devem ser usados sem moderação própria.
- Downloads last month
- -