Instructions to use MathAndMagic/polaris-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MathAndMagic/polaris-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MathAndMagic/polaris-small") 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("MathAndMagic/polaris-small") model = AutoModelForCausalLM.from_pretrained("MathAndMagic/polaris-small", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MathAndMagic/polaris-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MathAndMagic/polaris-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MathAndMagic/polaris-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MathAndMagic/polaris-small
- SGLang
How to use MathAndMagic/polaris-small 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 "MathAndMagic/polaris-small" \ --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": "MathAndMagic/polaris-small", "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 "MathAndMagic/polaris-small" \ --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": "MathAndMagic/polaris-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MathAndMagic/polaris-small with Docker Model Runner:
docker model run hf.co/MathAndMagic/polaris-small
Commit History
-
v0.2 (#2)
Verified signature- v0.2 (aefbfb1277bc08ec1f2166b03c0659eea6d6bae1) - Update README.md (a9df87be4af1c824c0a4d245ad25a1c9e16f65ff)f792b02
-
v0.0.1 (#1)
Verified signature- v0.0.1 (ee7c79363583e9a4452866cee0ffdf8e48a8745e) - Update README.md (9b58ac0e54f69c40dcb114cde336f85c9c096890)a68529a
-
Update README.md
Verified signature6450391 -
Update README.md
Verified signaturedb84809 -
Update README.md
Verified signatureaa5b14d -
v0.1
Verified signature4d61c06 -
Update README.md
Verified signaturec805b83 -
Update README.md
Verified signature49bdb0a -
Update README.md
Verified signature6c53af6 -
Update README.md
Verified signature7180102
-
Create README.md
Verified signaturedc6e8c9
-
Upload model files
Verified signaturee47322b -
initial commit
Verified signature65f2c81