Instructions to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Intel/gpt-oss-20b-gguf-q2ks-AutoRound", filename="gpt-oss-20b-32x2.4B-Q2_K_S.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S # Run inference directly in the terminal: llama-cli -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S # Run inference directly in the terminal: llama-cli -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
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 Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S # Run inference directly in the terminal: ./llama-cli -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
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 Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
Use Docker
docker model run hf.co/Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
- LM Studio
- Jan
- Ollama
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with Ollama:
ollama run hf.co/Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
- Unsloth Studio
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound 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 Intel/gpt-oss-20b-gguf-q2ks-AutoRound 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 Intel/gpt-oss-20b-gguf-q2ks-AutoRound to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Intel/gpt-oss-20b-gguf-q2ks-AutoRound to start chatting
- Pi
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
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 Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
Run Hermes
hermes
- Docker Model Runner
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with Docker Model Runner:
docker model run hf.co/Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
- Lemonade
How to use Intel/gpt-oss-20b-gguf-q2ks-AutoRound with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Intel/gpt-oss-20b-gguf-q2ks-AutoRound:Q2_K_S
Run and chat with the model
lemonade run user.gpt-oss-20b-gguf-q2ks-AutoRound-Q2_K_S
List all available models
lemonade list
Model Details
This model is a gguf q2ks format of openai/gpt-oss-20b generated by intel/auto-round algorithm.
Please follow the license of the original model.
How To Use
Llamacpp inference
llama-cli -hf Intel/gpt-oss-20b-gguf-q2ks-AutoRound
> Write a quick sort algorithm.
<|channel|>analysis<|message|>The user says: "Write a quick sort algorithm." They didn't specify language. Usually, we can answer with a generic explanation, maybe pseudocode. The user says "Write a quick sort algorithm." We should respond with a quick sort algorithm. Possibly in Python? Or a typical quick sort implementation. The user didn't specify the language. They might want a quicksort implementation. We can answer in Python. We can also explain the algorithm.
We should answer concisely but thorough. The user: "Write a quick sort algorithm." So we can just give code.
Thus the best solution: Provide quicksort algorithm in Python. Possibly iterative? But we can provide recursive quicksort.
We should mention the typical quicksort: pick pivot, partition, sort left, sort right.
We'll produce a quicksort function. Provide an implementation.
We can show both in-place quicksort and functional quicksort. The question didn't ask for any particular style, so just give a quicksort algorithm. So just provide code and explanation.
We can answer in a short format:
```
def quicksort(arr):
if len(arr)<=1:
return arr
pivot=arr[len(arr)//2]
left=[x for x in arr if x<pivot]
middle=[x for x in arr if x==pivot]
right=[x for x in arr if x>pivot]
return quicksort(left)+middle+quicksort(right)
```
Alternatively in-place:
```
def quicksort_inplace(arr, low, high):
if low<high:
pi = partition(arr, low, high)
quicksort_inplace(arr, low, pi-1)
quicksort_inplace(arr, pi+1, high)
```
We can provide partition:
```
def partition(arr, low, high):
pivot = arr[high]
i = low-1
for j in range(low, high):
if arr[j] < pivot:
i += 1
arr[i], arr[j] = arr[j], arr[i]
arr[i+1], arr[high] = arr[high], arr[i+1]
return i+1
```
Also mention complexity: average O(n log n), worst O(n^2).
We can provide the code. The user likely wants code. Provide a quicksort algorithm in Python or Java, etc.
We can provide in Python, as it's commonly used.
Let's produce a quicksort algorithm in Python. We'll explain the algorithm in a short explanation.
Ok.<|start|>assistant<|channel|>final<|message|>Here is a simple **quickβsort** implementation in Python (recursive, inβplace).
It works for any sequence that supports random access and comparison.
```python
def quicksort_inplace(a, low=0, high=None):
"""
Sorts the list `a` inβplace using the quickβsort algorithm.
:param a: list to sort
:param low: first index to sort (default 0)
:param high: last index to sort (default None, meaning the last element)
"""
if high is None:
high = len(a) - 1
if low < high:
p = partition(a, low, high) # pivot position after partition
quicksort_inplace(a, low, p - 1) # left subβarray
quicksort_inplace(a, p + 1, high) # right subβarray
def partition(a, low, high):
"""
Partitions the subβarray a[low:high+1] around a pivot.
Elements less than the pivot are moved to the left of the pivot,
elements greater or equal to the right.
Returns the final index of the pivot.
"""
pivot = a[high] # choose the rightβmost element as pivot
i = low - 1 # last element that is less than pivot
for j in range(low, high):
if a[j] < pivot:
i += 1
a[i], a[j] = a[j], a[i] # swap
# place pivot after the last smaller element
a[i + 1], a[high] = a[high], a[i + 1]
return i + 1
```
**How it works**
1. **Pivot**: In this example the rightβmost element is used as the pivot.
2. **Partition**: All elements `< pivot` are moved to the left side; all `>= pivot` stay on the right.
3. **Recursion**: After partitioning, we sort the left subβarray (`low` β¦ `p-1`) and the right subβarray (`p+1` β¦ `high`).
4. **Inβplace**: The algorithm sorts the original list without allocating additional memory for the subβarrays.
**Complexities**
- **Averageβcase**: `O(n log n)` β when partitions are roughly balanced.
- **Worstβcase**: `O(nΒ²)` β when partitions are highly unbalanced (e.g., already sorted input with the last element as pivot).
This can be mitigated by picking a random pivot or the medianβofβthree pivot.
You can run it on a list:
```python
data = [3, 6, 8, 10, 1, 2, 1]
quicksort_inplace(data)
print(data) # -> [1, 1, 2, 3, 6, 8, 10]
```
Feel free to adapt the code (e.g., use a random pivot or a different partition scheme) for your specific needs.
Generate the model
Requirement
pip install git+https://github.com/intel/auto-round.git@hengguo/gguf_update_0806
Here is the sample command to reproduce the model
auto_round --format gguf:q2_k_s --iters 0 --nsamples 512 --model openai/gpt-oss-20b --output_dir tmp_autoround
Ethical Considerations and Limitations
The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
Therefore, before deploying any applications of the model, developers should perform safety testing.
Caveats and Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
Here are a couple of useful links to learn more about Intel's AI software:
- Intel Neural Compressor link
Disclaimer
The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
Cite
@article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
- Downloads last month
- 34
2-bit
Model tree for Intel/gpt-oss-20b-gguf-q2ks-AutoRound
Base model
openai/gpt-oss-20b