Text Generation
Transformers
PyTorch
Safetensors
English
llama
pretrained
mistral-common
text-generation-inference
Instructions to use chatpbc1/chatpbc-v33 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chatpbc1/chatpbc-v33 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chatpbc1/chatpbc-v33")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("chatpbc1/chatpbc-v33") model = AutoModelForCausalLM.from_pretrained("chatpbc1/chatpbc-v33", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chatpbc1/chatpbc-v33 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Install mistral-common: pip install --upgrade mistral-common # Start the vLLM server: vllm serve "chatpbc1/chatpbc-v33" --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chatpbc1/chatpbc-v33", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/chatpbc1/chatpbc-v33
- SGLang
How to use chatpbc1/chatpbc-v33 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 "chatpbc1/chatpbc-v33" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chatpbc1/chatpbc-v33", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "chatpbc1/chatpbc-v33" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chatpbc1/chatpbc-v33", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use chatpbc1/chatpbc-v33 with Docker Model Runner:
docker model run hf.co/chatpbc1/chatpbc-v33
| # ChatPBC Model Deployment Checklist | |
| **Developed by Mik Tse Agency** | |
| --- | |
| ## PRE-DEPLOYMENT REQUIREMENTS | |
| 1. **Model Repo Structure** (REQUIRED for HF Inference API to work): | |
| - [ ] `config.json` with `model_type` field present | |
| - [ ] `model.safetensors` OR `pytorch_model.bin` (actual weight files, NOT empty placeholders) | |
| - [ ] `tokenizer_config.json` | |
| - [ ] `tokenizer.model` OR `tokenizer.json` | |
| - [ ] `special_tokens_map.json` | |
| - [ ] `generation_config.json` | |
| - [ ] `README.md` with `pipeline_tag: text-generation` in YAML front matter | |
| 2. **If using LoRA adapters**: | |
| - [ ] `adapter_config.json` with `base_model_name_or_path` pointing to a real, accessible HF model | |
| - [ ] `adapter_model.safetensors` with actual trained weights (NOT 0.1 KB placeholder) | |
| - [ ] The base model must be publicly accessible on HF | |
| - [ ] Use `merge_and_unload()` to create a standalone model for Inference API compatibility | |
| 3. **HF Inference API Requirements**: | |
| - [ ] Model repo is PUBLIC (not private) | |
| - [ ] `pipeline_tag: text-generation` set in model card YAML | |
| - [ ] `library_name: transformers` set in model card YAML | |
| - [ ] Model is NOT gated/restricted | |
| - [ ] HF Token has read access to the model | |
| 4. **Chat Template Verification**: | |
| - [ ] Confirm `tokenizer_config.json` has `chat_template` field | |
| - [ ] For Llama-2 models: use `[INST]` format | |
| - [ ] For Mistral/Zephyr: use `<|user|>` format | |
| - [ ] For ChatML: use `<|im_start|>` format | |
| - [ ] Match the prompt format in ALL code (Python, JavaScript, Gradio) | |
| 5. **API Call Verification**: | |
| - [ ] Endpoint: `https://router.huggingface.co/v1/chat/completions` (for router) or `https://api-inference.huggingface.co/models/{model_id}` | |
| - [ ] Headers: `Authorization: Bearer {HF_TOKEN}`, `Content-Type: application/json` | |
| - [ ] Body: `inputs` (string) or `messages` (array), parameters (`max_new_tokens`, `temperature`, `do_sample`, `return_full_text: false`) | |
| - [ ] Options: `wait_for_model: true` (prevents immediate 503 failure) | |
| - [ ] Retry logic: 5 retries, 10 second delay between retries | |
| - [ ] Timeout: 180 seconds minimum | |
| 6. **Demo Verification**: | |
| - [ ] Open HTML demo in browser | |
| - [ ] Send "Hi" β model should respond with a greeting | |
| - [ ] Send "My business is struggling" β model should show empathy | |
| - [ ] Send "Tell me more about what I said earlier" β model should reference earlier message | |
| - [ ] Verify no base model names appear anywhere in the UI | |
| - [ ] Test dark/light mode toggle | |
| - [ ] Test model selector (V4 vs V3.3) | |
| - [ ] Test clear conversation button | |
| 7. **Common Errors and Fixes**: | |
| - [ ] **503 "Model is currently loading"** β Add `wait_for_model: true` and retry with 20s delay | |
| - [ ] **400 "Model not supported by provider"** β Model is LoRA adapter, needs `merge_and_unload` or full weights | |
| - [ ] **"trouble connecting" in demo** β Check API endpoint URL, check HF token validity, check model is public | |
| - [ ] **Empty responses** β Check `return_full_text: false`, check prompt format matches tokenizer template | |
| - [ ] **DNS resolution failure** β Only occurs in restricted sandbox environments, not in production | |
| 8. **Post-Deployment Verification**: | |
| - [ ] Test API directly with curl or Python requests from a non-sandbox environment | |
| - [ ] Verify multi-turn memory works (5 turns minimum) | |
| - [ ] Verify model introduces itself on first message | |
| - [ ] Verify model remembers context from turn 1 when at turn 5 | |
| - [ ] Both repos show as public on `huggingface.co/chatpbc1` | |