Instructions to use PleIAs/Monad with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PleIAs/Monad with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PleIAs/Monad") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PleIAs/Monad") model = AutoModelForCausalLM.from_pretrained("PleIAs/Monad") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PleIAs/Monad with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PleIAs/Monad" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PleIAs/Monad", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PleIAs/Monad
- SGLang
How to use PleIAs/Monad 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 "PleIAs/Monad" \ --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": "PleIAs/Monad", "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 "PleIAs/Monad" \ --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": "PleIAs/Monad", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PleIAs/Monad with Docker Model Runner:
docker model run hf.co/PleIAs/Monad
"Use this model" boilerplate for Transformers doesn't work
I find your work very interesting and would like to explore what can be done with these very small models. I am trying to configure this model to run locally with transformers and have encountered some hiccups in the configuration. The chat template is not applied by the AutoTokenizer causing an error, so I manually set it to reflect the chat_template.json file.
At this point the eos_token and bos_token are still not set, and while checking the rest of the config I found conflicting information:
chat_template.json indicates the tokens should be <|im_start|> and <|im_end|>;config.json indicates "bos_token_id": 1, "eos_token_id": 2;tokenizer.json and tokenizer_config.json both indicate the token ids for 1 and 2 as <|begin_of_text|> and <|end_of_text|>; not <|im_start|> or <|im_end|>
However, the model card would indicate <|im_start|>/<|im_end|> as the intended tokens. I have limited experience with manual configuration, so I am unsure how to proceed; should I modify the tokenizer config, or the chat template? Manually setting tokenizer.bos_token="<|im_start|>"; tokenizer.eos_token="<|im_end|>" does allow the model to generate, however the output is severely degraded and runs slower than even my local Llama 8B model. This could also (likely) be due to another part of the configuration that wasn't applied by AutoTokenizer/AutoModel.
It would be great if the model could be updated to configure properly through AutoTokenizer/AutoModel, but if that's not currently a priority, I would appreciate more information on how it is intended to be configured in transformers (or another library). I suspect I am missing something fairly simple, so thank you for your time and patience with this issue!