Text Generation
Transformers
Safetensors
English
French
maplept
feature-extraction
phi-3
canxp
canada
sovereign-ai
conversational
ethical-ai
large-language-model
bilingual
custom_code
Instructions to use canxp-ai/canxpai-maplept-mini-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use canxp-ai/canxpai-maplept-mini-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="canxp-ai/canxpai-maplept-mini-v1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("canxp-ai/canxpai-maplept-mini-v1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use canxp-ai/canxpai-maplept-mini-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "canxp-ai/canxpai-maplept-mini-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "canxp-ai/canxpai-maplept-mini-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/canxp-ai/canxpai-maplept-mini-v1
- SGLang
How to use canxp-ai/canxpai-maplept-mini-v1 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 "canxp-ai/canxpai-maplept-mini-v1" \ --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": "canxp-ai/canxpai-maplept-mini-v1", "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 "canxp-ai/canxpai-maplept-mini-v1" \ --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": "canxp-ai/canxpai-maplept-mini-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use canxp-ai/canxpai-maplept-mini-v1 with Docker Model Runner:
docker model run hf.co/canxp-ai/canxpai-maplept-mini-v1
Download modeling_maplept.py from canxp-ai/canxpai-maplept-mini-v1: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/canxp-ai/canxpai-maplept-mini-v1/resolve/main/modeling_maplept.py
- Command line
-
hf download hf://canxp-ai/canxpai-maplept-mini-v1/modeling_maplept.py
-
curl -L -o modeling_maplept.py https://huggingface.co/canxp-ai/canxpai-maplept-mini-v1/resolve/main/modeling_maplept.py
1.81 kB
| from transformers.models.phi3.modeling_phi3 import Phi3ForCausalLM | |
| from transformers import AutoConfig, AutoModelForCausalLM | |
| from .configuration_maplept import MaplePTConfig | |
| import torch.nn as nn | |
| class MaplePTForCausalLM(Phi3ForCausalLM): | |
| config_class = MaplePTConfig | |
| model_type = "maplept" | |
| def __init__(self, config): | |
| if not isinstance(config, MaplePTConfig): | |
| config = MaplePTConfig.from_dict(config.to_dict()) | |
| super().__init__(config) | |
| base = getattr(self, "model", None) | |
| if base is None: | |
| return | |
| # --- ensure embed_tokens alias --- | |
| if hasattr(base, "embed_tokens"): | |
| self.embed_tokens = base.embed_tokens | |
| # --- ensure model.layers alias (vLLM critical) --- | |
| # vLLM searches model.layers.*, but Phi3 nests them in model.model.layers | |
| if not hasattr(base, "layers"): | |
| try: | |
| base.layers = base.model.layers | |
| print("✅ Aliased base.layers → base.model.layers") | |
| except AttributeError: | |
| print("⚠️ Could not alias layers (missing model.model.layers)") | |
| # --- ensure top-level direct alias too --- | |
| if not hasattr(self, "layers") and hasattr(base, "layers"): | |
| self.layers = base.layers | |
| print("✅ Aliased self.layers → model.layers") | |
| # --- ensure normalization aliases (for completeness) --- | |
| if not hasattr(base, "norm"): | |
| if hasattr(base, "final_layernorm"): | |
| base.norm = base.final_layernorm | |
| elif hasattr(base, "model") and hasattr(base.model, "final_layernorm"): | |
| base.norm = base.model.final_layernorm | |
| if not hasattr(self, "norm") and hasattr(base, "norm"): | |
| self.norm = base.norm | |