Instructions to use MartinNav/compliantLLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MartinNav/compliantLLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MartinNav/compliantLLM", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MartinNav/compliantLLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MartinNav/compliantLLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MartinNav/compliantLLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MartinNav/compliantLLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MartinNav/compliantLLM
- SGLang
How to use MartinNav/compliantLLM 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 "MartinNav/compliantLLM" \ --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": "MartinNav/compliantLLM", "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 "MartinNav/compliantLLM" \ --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": "MartinNav/compliantLLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MartinNav/compliantLLM with Docker Model Runner:
docker model run hf.co/MartinNav/compliantLLM
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - custom_code | |
| - meme | |
| # compliantLLM | |
| `compliantLLM` is a 149,379-parameter custom Hugging Face model trained on 2,048 | |
| conversation contexts from `OpenAssistant/oasst1`. Every prompt produces three | |
| output-vocabulary tokens: | |
| ```text | |
| Sorry, but that question violates GDPR.<|end_turn|><|eos|> | |
| ``` | |
| The input side uses an exact 256-entry byte-level, zero-merge BPE vocabulary and | |
| supports a 1,024-token context. The output side has a separate three-token | |
| vocabulary. | |
| ## Inference | |
| Install the three runtime dependencies: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| Run the bundled entry point: | |
| ```bash | |
| python inference.py "Can you process my personal data?" | |
| ``` | |
| Or use the Hugging Face auto classes: | |
| ```python | |
| from transformers import AutoModel, AutoTokenizer | |
| repo = "./compliantLLM" | |
| tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True) | |
| model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval() | |
| inputs = tokenizer( | |
| "Can you process my personal data?", | |
| return_tensors="pt", | |
| truncation=True, | |
| max_length=1024, | |
| ) | |
| output_ids = model.generate(**inputs)[0] | |
| print(model.decode_output(output_ids)) | |
| ``` | |
| `trust_remote_code=True` is required because the asymmetric encoder/output | |
| architecture is custom rather than a stock Transformers causal LM. | |
| ## Repository contents | |
| - `model.safetensors`: FP32 trained weights | |
| - `config.json`: architecture and output vocabulary | |
| - `configuration_compliant_llm.py`: Transformers configuration | |
| - `modeling_compliant_llm.py`: inference-only model implementation | |
| - `tokenization_compliant_llm.py`: 256-byte tokenizer | |
| - `vocab.json`: tokenizer vocabulary | |
| - `inference.py`: standalone command-line example | |
| The training pipeline and dataset are intentionally excluded. | |