Instructions to use chargoddard/mixtralnt-4x7b-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chargoddard/mixtralnt-4x7b-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chargoddard/mixtralnt-4x7b-test")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("chargoddard/mixtralnt-4x7b-test") model = AutoModelForCausalLM.from_pretrained("chargoddard/mixtralnt-4x7b-test", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chargoddard/mixtralnt-4x7b-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chargoddard/mixtralnt-4x7b-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chargoddard/mixtralnt-4x7b-test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/chargoddard/mixtralnt-4x7b-test
- SGLang
How to use chargoddard/mixtralnt-4x7b-test 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 "chargoddard/mixtralnt-4x7b-test" \ --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": "chargoddard/mixtralnt-4x7b-test", "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 "chargoddard/mixtralnt-4x7b-test" \ --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": "chargoddard/mixtralnt-4x7b-test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use chargoddard/mixtralnt-4x7b-test with Docker Model Runner:
docker model run hf.co/chargoddard/mixtralnt-4x7b-test
Hybrid approach?
So I saw the work momonga is doing here to extract the models from Mixtral 8x, so you have less experts. https://huggingface.co/mmnga/Mixtral-Extraction-4x7B-Instruct-v0.1
I wondered if it might be possible to have a hybrid approach combining his approach and yours?
For example extract 2 of the experts from the original model, using the original gating they have, and mix that with one new MoE expert with synthetic gating for a 3x7b with pretty decent gating off the bat?
Obviously all this is experimental and crazy, and maybe this wouldn't work at all. But if you could somehow encorporate some the original experts and gating the resulting MoE might be more effective (and possibly a better point to fine tune from)?
Oh, and perhaps you could merge models with the original 8 models too (merge 4 mistral fine tunes with each mistral expert and merge the gating between the original and new synthetic based ones)
Just rambling π€·ββοΈπ€£