Instructions to use second-state/C4AI-Command-R-v01-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use second-state/C4AI-Command-R-v01-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="second-state/C4AI-Command-R-v01-GGUF", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("second-state/C4AI-Command-R-v01-GGUF", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("second-state/C4AI-Command-R-v01-GGUF", trust_remote_code=True) - llama-cpp-python
How to use second-state/C4AI-Command-R-v01-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="second-state/C4AI-Command-R-v01-GGUF", filename="c4ai-command-r-v01-Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use second-state/C4AI-Command-R-v01-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
Use Docker
docker model run hf.co/second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use second-state/C4AI-Command-R-v01-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "second-state/C4AI-Command-R-v01-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "second-state/C4AI-Command-R-v01-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
- SGLang
How to use second-state/C4AI-Command-R-v01-GGUF 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 "second-state/C4AI-Command-R-v01-GGUF" \ --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": "second-state/C4AI-Command-R-v01-GGUF", "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 "second-state/C4AI-Command-R-v01-GGUF" \ --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": "second-state/C4AI-Command-R-v01-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use second-state/C4AI-Command-R-v01-GGUF with Ollama:
ollama run hf.co/second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
- Unsloth Studio new
How to use second-state/C4AI-Command-R-v01-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for second-state/C4AI-Command-R-v01-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for second-state/C4AI-Command-R-v01-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for second-state/C4AI-Command-R-v01-GGUF to start chatting
- Docker Model Runner
How to use second-state/C4AI-Command-R-v01-GGUF with Docker Model Runner:
docker model run hf.co/second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
- Lemonade
How to use second-state/C4AI-Command-R-v01-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull second-state/C4AI-Command-R-v01-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.C4AI-Command-R-v01-GGUF-Q4_K_M
List all available models
lemonade list
Xin Liu commited on
Commit ·
d37d4c8
1
Parent(s): eda80f2
Update
Browse filesSigned-off-by: Xin Liu <sam@secondstate.io>
README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: CohereForAI/c4ai-command-r-v01
|
| 3 |
+
inference: false
|
| 4 |
+
library_name: transformers
|
| 5 |
+
license: cc-by-nc-4.0
|
| 6 |
+
model_creator: Cohere
|
| 7 |
+
model_name: C4AI Command-R
|
| 8 |
+
quantized_by: Second State Inc.
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
- fr
|
| 12 |
+
- de
|
| 13 |
+
- es
|
| 14 |
+
- it
|
| 15 |
+
- pt
|
| 16 |
+
- ja
|
| 17 |
+
- ko
|
| 18 |
+
- zh
|
| 19 |
+
- ar
|
| 20 |
---
|
| 21 |
+
|
| 22 |
+
<!-- header start -->
|
| 23 |
+
<!-- 200823 -->
|
| 24 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
| 25 |
+
<img src="https://github.com/LlamaEdge/LlamaEdge/raw/dev/assets/logo.svg" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
| 26 |
+
</div>
|
| 27 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
| 28 |
+
<!-- header end -->
|
| 29 |
+
|
| 30 |
+
# C4AI-Command-R-v01-GGUF
|
| 31 |
+
|
| 32 |
+
## Original Model
|
| 33 |
+
|
| 34 |
+
[second-state/C4AI-Command-R-v01-GGUF](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF)
|
| 35 |
+
|
| 36 |
+
## Run with LlamaEdge
|
| 37 |
+
|
| 38 |
+
- LlamaEdge version: coming soon
|
| 39 |
+
|
| 40 |
+
## Quantized GGUF Models
|
| 41 |
+
|
| 42 |
+
| Name | Quant method | Bits | Size | Use case |
|
| 43 |
+
| ---- | ---- | ---- | ---- | ----- |
|
| 44 |
+
| [c4ai-command-r-v01-Q2_K.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q2_K.gguf) | Q2_K | 2 | 13.8 GB| smallest, significant quality loss - not recommended for most purposes |
|
| 45 |
+
| [c4ai-command-r-v01-Q3_K_L.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q3_K_L.gguf) | Q3_K_L | 3 | 19.1 GB| small, substantial quality loss |
|
| 46 |
+
| [c4ai-command-r-v01-Q3_K_M.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q3_K_M.gguf) | Q3_K_M | 3 | 17.6 GB| very small, high quality loss |
|
| 47 |
+
| [c4ai-command-r-v01-Q3_K_S.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q3_K_S.gguf) | Q3_K_S | 3 | 15.9 GB| very small, high quality loss |
|
| 48 |
+
| [c4ai-command-r-v01-Q4_0.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q4_0.gguf) | Q4_0 | 4 | 20.2 GB| legacy; small, very high quality loss - prefer using Q3_K_M |
|
| 49 |
+
| [c4ai-command-r-v01-Q4_K_M.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q4_K_M.gguf) | Q4_K_M | 4 | 21.5 GB| medium, balanced quality - recommended |
|
| 50 |
+
| [c4ai-command-r-v01-Q4_K_S.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q4_K_S.gguf) | Q4_K_S | 4 | 20.4 GB| small, greater quality loss |
|
| 51 |
+
| [c4ai-command-r-v01-Q5_0.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q5_0.gguf) | Q5_0 | 5 | 24.3 GB| legacy; medium, balanced quality - prefer using Q4_K_M |
|
| 52 |
+
| [c4ai-command-r-v01-Q5_K_M.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q5_K_M.gguf) | Q5_K_M | 5 | 25 GB| large, very low quality loss - recommended |
|
| 53 |
+
| [c4ai-command-r-v01-Q5_K_S.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q5_K_S.gguf) | Q5_K_S | 5 | 24.3 GB| large, low quality loss - recommended |
|
| 54 |
+
| [c4ai-command-r-v01-Q6_K.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q6_K.gguf) | Q6_K | 6 | 28.7 GB| very large, extremely low quality loss |
|
| 55 |
+
| [c4ai-command-r-v01-Q8_0.gguf](https://huggingface.co/second-state/C4AI-Command-R-v01-GGUF/blob/main/c4ai-command-r-v01-Q8_0.gguf) | Q8_0 | 8 | 37.2 GB| very large, extremely low quality loss - not recommended |
|
| 56 |
+
|
| 57 |
+
*Quantized with llama.cpp b2450*
|