Instructions to use louisbrulenaudet/DevPearl-2x7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use louisbrulenaudet/DevPearl-2x7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="louisbrulenaudet/DevPearl-2x7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("louisbrulenaudet/DevPearl-2x7B") model = AutoModelForCausalLM.from_pretrained("louisbrulenaudet/DevPearl-2x7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use louisbrulenaudet/DevPearl-2x7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "louisbrulenaudet/DevPearl-2x7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "louisbrulenaudet/DevPearl-2x7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/louisbrulenaudet/DevPearl-2x7B
- SGLang
How to use louisbrulenaudet/DevPearl-2x7B 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 "louisbrulenaudet/DevPearl-2x7B" \ --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": "louisbrulenaudet/DevPearl-2x7B", "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 "louisbrulenaudet/DevPearl-2x7B" \ --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": "louisbrulenaudet/DevPearl-2x7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use louisbrulenaudet/DevPearl-2x7B with Docker Model Runner:
docker model run hf.co/louisbrulenaudet/DevPearl-2x7B

DevPearl-2x7B, an xtraordinary Mixture of Experts (MoE) for development
DevPearl-2x7B is a Mixture of Experts (MoE) made with the following models :
A Mixture of Experts (MoE) model represents a sophisticated architecture that amalgamates the capabilities of multiple specialized models to address a wide array of tasks within a unified framework. Within the realm of a MoE model tailored for a chat application, the integration of expertise spanning three distinct domains - chat, code, and mathematics - substantially enhances its capacity to furnish nuanced and precise responses to a diverse spectrum of user inquiries.
Configuration
base_model: codellama/CodeLlama-7b-Instruct-hf
experts:
- source_model: deepseek-ai/deepseek-coder-6.7b-instruct
positive_prompts:
- "python"
- "javascript"
- "java"
- source_model: defog/sqlcoder-7b-2
positive_prompts:
- "SQL"
Usage
!pip install -qU transformers bitsandbytes accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "louisbrulenaudet/DevPearl-2x7B"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
)
messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
Citing & Authors
If you use this code in your research, please use the following BibTeX entry.
@misc{louisbrulenaudet2023,
author = {Louis Brulé Naudet},
title = {DevPearl-2x7B, an xtraordinary Mixture of Experts (MoE) for development},
year = {2024}
howpublished = {\url{https://huggingface.co/louisbrulenaudet/DevPearl-2x7B}},
}
Feedback
If you have any feedback, please reach out at louisbrulenaudet@icloud.com.
- Downloads last month
- 10