Text Generation
Safetensors
Transformers
MLX
vllm
mistral
conversational
text-generation-inference
8-bit precision
Instructions to use moot20/Velvet-14B-MLX-8bits with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moot20/Velvet-14B-MLX-8bits with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="moot20/Velvet-14B-MLX-8bits") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("moot20/Velvet-14B-MLX-8bits") model = AutoModelForCausalLM.from_pretrained("moot20/Velvet-14B-MLX-8bits") 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]:])) - MLX
How to use moot20/Velvet-14B-MLX-8bits with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("moot20/Velvet-14B-MLX-8bits") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use moot20/Velvet-14B-MLX-8bits with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moot20/Velvet-14B-MLX-8bits" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moot20/Velvet-14B-MLX-8bits", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/moot20/Velvet-14B-MLX-8bits
- SGLang
How to use moot20/Velvet-14B-MLX-8bits 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 "moot20/Velvet-14B-MLX-8bits" \ --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": "moot20/Velvet-14B-MLX-8bits", "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 "moot20/Velvet-14B-MLX-8bits" \ --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": "moot20/Velvet-14B-MLX-8bits", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi
How to use moot20/Velvet-14B-MLX-8bits with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "moot20/Velvet-14B-MLX-8bits"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "moot20/Velvet-14B-MLX-8bits" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use moot20/Velvet-14B-MLX-8bits with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "moot20/Velvet-14B-MLX-8bits"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default moot20/Velvet-14B-MLX-8bits
Run Hermes
hermes
- MLX LM
How to use moot20/Velvet-14B-MLX-8bits with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "moot20/Velvet-14B-MLX-8bits"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "moot20/Velvet-14B-MLX-8bits" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moot20/Velvet-14B-MLX-8bits", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use moot20/Velvet-14B-MLX-8bits with Docker Model Runner:
docker model run hf.co/moot20/Velvet-14B-MLX-8bits
Add files using upload-large-folder tool
Browse files- README.md +47 -0
- config.json +34 -0
- model-00001-of-00003.safetensors +3 -0
- model-00002-of-00003.safetensors +3 -0
- model-00003-of-00003.safetensors +3 -0
- model.safetensors.index.json +0 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- fr
|
| 5 |
+
- de
|
| 6 |
+
- es
|
| 7 |
+
- it
|
| 8 |
+
- pt
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
library_name: vllm
|
| 11 |
+
inference: false
|
| 12 |
+
extra_gated_description: If you want to learn more about how we process your personal
|
| 13 |
+
data, please read our <a href="https://www.almawave.com/privacy-policy/">Privacy
|
| 14 |
+
Policy</a>.
|
| 15 |
+
tags:
|
| 16 |
+
- transformers
|
| 17 |
+
- mlx
|
| 18 |
+
base_model: Almawave/Velvet-14B
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# moot20/Velvet-14B-MLX-8bits
|
| 22 |
+
|
| 23 |
+
The Model [moot20/Velvet-14B-MLX-8bits](https://huggingface.co/moot20/Velvet-14B-MLX-8bits) was
|
| 24 |
+
converted to MLX format from [Almawave/Velvet-14B](https://huggingface.co/Almawave/Velvet-14B)
|
| 25 |
+
using mlx-lm version **0.21.1**.
|
| 26 |
+
|
| 27 |
+
## Use with mlx
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
pip install mlx-lm
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from mlx_lm import load, generate
|
| 35 |
+
|
| 36 |
+
model, tokenizer = load("moot20/Velvet-14B-MLX-8bits")
|
| 37 |
+
|
| 38 |
+
prompt = "hello"
|
| 39 |
+
|
| 40 |
+
if tokenizer.chat_template is not None:
|
| 41 |
+
messages = [{"role": "user", "content": prompt}]
|
| 42 |
+
prompt = tokenizer.apply_chat_template(
|
| 43 |
+
messages, add_generation_prompt=True
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 47 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MistralForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 1,
|
| 7 |
+
"eos_token_id": 2,
|
| 8 |
+
"head_dim": 128,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 5120,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 12544,
|
| 13 |
+
"max_position_embeddings": 131072,
|
| 14 |
+
"model_type": "mistral",
|
| 15 |
+
"num_attention_heads": 40,
|
| 16 |
+
"num_hidden_layers": 50,
|
| 17 |
+
"num_key_value_heads": 8,
|
| 18 |
+
"quantization": {
|
| 19 |
+
"group_size": 64,
|
| 20 |
+
"bits": 8
|
| 21 |
+
},
|
| 22 |
+
"quantization_config": {
|
| 23 |
+
"group_size": 64,
|
| 24 |
+
"bits": 8
|
| 25 |
+
},
|
| 26 |
+
"rms_norm_eps": 1e-05,
|
| 27 |
+
"rope_theta": 1000000.0,
|
| 28 |
+
"sliding_window": null,
|
| 29 |
+
"tie_word_embeddings": false,
|
| 30 |
+
"torch_dtype": "bfloat16",
|
| 31 |
+
"transformers_version": "4.44.2",
|
| 32 |
+
"use_cache": false,
|
| 33 |
+
"vocab_size": 126976
|
| 34 |
+
}
|
model-00001-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d7d844bf3678d40094e31d62103d008c4d6400a735a70437d2675e72dcc4044
|
| 3 |
+
size 5346738871
|
model-00002-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:427a80090de98eefcee1536ae903699c57144d3e5f0d8891bdccbb7d51584b77
|
| 3 |
+
size 5324502795
|
model-00003-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b49571a83c6968668ad655d390e57dd7cc208f490fa6e487934c03c196e29da6
|
| 3 |
+
size 4289663301
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "</s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<pad>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|