Instructions to use MiniMaxAI/MiniMax-Text-01-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiniMaxAI/MiniMax-Text-01-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MiniMaxAI/MiniMax-Text-01-hf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MiniMaxAI/MiniMax-Text-01-hf") model = AutoModelForCausalLM.from_pretrained("MiniMaxAI/MiniMax-Text-01-hf") 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
- vLLM
How to use MiniMaxAI/MiniMax-Text-01-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MiniMaxAI/MiniMax-Text-01-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-Text-01-hf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MiniMaxAI/MiniMax-Text-01-hf
- SGLang
How to use MiniMaxAI/MiniMax-Text-01-hf 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 "MiniMaxAI/MiniMax-Text-01-hf" \ --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": "MiniMaxAI/MiniMax-Text-01-hf", "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 "MiniMaxAI/MiniMax-Text-01-hf" \ --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": "MiniMaxAI/MiniMax-Text-01-hf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MiniMaxAI/MiniMax-Text-01-hf with Docker Model Runner:
docker model run hf.co/MiniMaxAI/MiniMax-Text-01-hf
| <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 375.14 375.14"><defs><style>.cls-1{fill:url(#未命名的渐变_14);}</style><linearGradient id="未命名的渐变_14" x1="8.42" y1="13.81" x2="429.65" y2="422.37" gradientUnits="userSpaceOnUse"><stop offset="0.09" stop-color="#ffab0c"/><stop offset="0.31" stop-color="#ff5538"/><stop offset="0.46" stop-color="#e9405d"/><stop offset="0.75" stop-color="#d266da"/><stop offset="0.89" stop-color="#d584ef"/></linearGradient></defs><title>资源 5</title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><path class="cls-1" d="M375.14,187.57C375.14,84,290.74-.26,187.09,0,84.26.26.26,84.25,0,187.09c-.26,103.65,84,188,187.57,188H310.82A64.21,64.21,0,0,0,375,310.93V193.82h0C375.09,191.75,375.14,189.67,375.14,187.57Zm-284,104.17c-29.86-25.49-48.26-66.27-47.4-107.85q.09-4.38.46-8.73V175c4.32-49.6,36.37-95.88,81.29-117.36S226.52,40.21,267.85,68s66.32,78.21,63.4,127.92a178,178,0,0,1-5.14,32.25c-1,4.2-2.3,8.57-5.28,11.72s-8.2,4.6-11.73,2.09c-3.37-2.41-3.87-7.12-4.16-11.25-2.33-33.37-11.24-67.76-33.79-92.47a103.67,103.67,0,0,0-66.38-32.84A107.19,107.19,0,0,0,133.22,125C116,137.27,102.55,154.88,96,175s-5.86,42.61,2.71,61.93a81.89,81.89,0,0,0,29.71,35c22.94,15.06,54.31,17.2,78.14,3.6s38.07-43.1,32-69.86S205.4,158,178.11,160.84c-4.16.43-10.13,0-10.28-4.21-.12-3.24,3.77-4.94,7-5.52,27.68-5,57.34,9.09,72.53,32.77s16,55.41,3.56,80.66-37,43.69-64.36,50.35C149.68,323.87,116.31,313.25,91.11,291.74Z"/></g></g></svg> |