Instructions to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PORTULAN/gervasio-8b-portuguese-ptpt-decoder") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PORTULAN/gervasio-8b-portuguese-ptpt-decoder") model = AutoModelForCausalLM.from_pretrained("PORTULAN/gervasio-8b-portuguese-ptpt-decoder", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder 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 PORTULAN/gervasio-8b-portuguese-ptpt-decoder # Run inference directly in the terminal: llama cli -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder # Run inference directly in the terminal: llama cli -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder
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 PORTULAN/gervasio-8b-portuguese-ptpt-decoder # Run inference directly in the terminal: ./build/bin/llama cli -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder
Use Docker
docker model run hf.co/PORTULAN/gervasio-8b-portuguese-ptpt-decoder
- Llama new
- LM Studio
- Jan
- vLLM
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PORTULAN/gervasio-8b-portuguese-ptpt-decoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PORTULAN/gervasio-8b-portuguese-ptpt-decoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PORTULAN/gervasio-8b-portuguese-ptpt-decoder
- SGLang
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder 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 "PORTULAN/gervasio-8b-portuguese-ptpt-decoder" \ --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": "PORTULAN/gervasio-8b-portuguese-ptpt-decoder", "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 "PORTULAN/gervasio-8b-portuguese-ptpt-decoder" \ --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": "PORTULAN/gervasio-8b-portuguese-ptpt-decoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with Ollama:
ollama run hf.co/PORTULAN/gervasio-8b-portuguese-ptpt-decoder
- Unsloth Desktop
- Pi
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder
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": "PORTULAN/gervasio-8b-portuguese-ptpt-decoder" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with Docker Model Runner:
docker model run hf.co/PORTULAN/gervasio-8b-portuguese-ptpt-decoder
- Lemonade
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull PORTULAN/gervasio-8b-portuguese-ptpt-decoder
Run and chat with the model
lemonade run user.gervasio-8b-portuguese-ptpt-decoder-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder
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 PORTULAN/gervasio-8b-portuguese-ptpt-decoder
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use PORTULAN/gervasio-8b-portuguese-ptpt-decoder with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PORTULAN/gervasio-8b-portuguese-ptpt-decoder
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 "PORTULAN/gervasio-8b-portuguese-ptpt-decoder" \ --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"
Upload model.safetensors.index.json
Hi there!
While trying to load PORTULAN/gervasio-8b-portuguese-ptpt-decoder I ran into this error:
File ".../transformers/modeling_utils.py", line 1243, in _get_resolved_checkpoint_files
raise OSError(
OSError: PORTULAN/gervasio-8b-portuguese-ptpt-decoder does not appear to have a file named
pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt or flax_model.msgpack.
After a bit of digging I discovered the cause:
the weights are split across four .safetensors shards, but the repository doesn’t include the
index file (model.safetensors.index.json) that tells HF Transformers how to stitch those shards
together.
This PR simply adds that index file. Feel free to regenerate it yourself or keep this one—either
way the model loads correctly once the file is present. 🚀
Follow-up question
Do you plan to release a Brazilian-Portuguese variant (something likegervasio-8b-portuguese-ptbr-decoder), similar to what you did for the 7 B model?
Or does the 8 B checkpoint already cover both pt-PT and pt-BR?
I noticed the 7 B models were deprecated and was a bit unsure about the naming.
Thanks—and great work on these models!
Thank you for reporting the error. I missed that file when uploading the model to huggingface.
I have now included the original model.safetensors.index.json in the repository. For some reason the value in metadata/total_size is slightly different from the one in your file. Maybe it was computed in a different way.
Thanks, once again.
About your follow-up question:
Since there are several pt-BR models available on hugging face, we are currently focusing on pt-PT models and have no plans to release pt-BR versions of Gervásio soon. However, I wouldn't be surprised if the current 8B Gervásio pt-PT performed better than the old/deprecated 7B Gervásio pt-BR in pt-BR tasks/datasets.
Best regards and thanks for your interest in Gervásio models!
Luís