Instructions to use Intel/gpt-oss-20b-gguf-q4ks-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-q4ks-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-q4ks-AutoRound", filename="gpt-oss-20b-32x2.4B-Q4_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-q4ks-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-q4ks-AutoRound:Q4_K_S # Run inference directly in the terminal: llama-cli -hf Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_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-q4ks-AutoRound:Q4_K_S # Run inference directly in the terminal: llama-cli -hf Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_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-q4ks-AutoRound:Q4_K_S # Run inference directly in the terminal: ./llama-cli -hf Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_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-q4ks-AutoRound:Q4_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_K_S
Use Docker
docker model run hf.co/Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_K_S
- LM Studio
- Jan
- Ollama
How to use Intel/gpt-oss-20b-gguf-q4ks-AutoRound with Ollama:
ollama run hf.co/Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_K_S
- Unsloth Studio
How to use Intel/gpt-oss-20b-gguf-q4ks-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-q4ks-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-q4ks-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-q4ks-AutoRound to start chatting
- Pi
How to use Intel/gpt-oss-20b-gguf-q4ks-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-q4ks-AutoRound:Q4_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-q4ks-AutoRound:Q4_K_S" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Intel/gpt-oss-20b-gguf-q4ks-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-q4ks-AutoRound:Q4_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-q4ks-AutoRound:Q4_K_S
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use Intel/gpt-oss-20b-gguf-q4ks-AutoRound with Docker Model Runner:
docker model run hf.co/Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_K_S
- Lemonade
How to use Intel/gpt-oss-20b-gguf-q4ks-AutoRound with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Intel/gpt-oss-20b-gguf-q4ks-AutoRound:Q4_K_S
Run and chat with the model
lemonade run user.gpt-oss-20b-gguf-q4ks-AutoRound-Q4_K_S
List all available models
lemonade list
Model Details
This model is a gguf q4ks 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-q4ks-AutoRound
> Write a quick sort algorithm.
<|channel|>analysis<|message|>We need to write quick sort algorithm. The user wants a quick sort algorithm. Provide code? They didn't specify language. I can provide a general quick sort algorithm, maybe in Python, C++, Java, etc. Provide explanation. Provide typical implementation. I'll respond with explanation and code.<|start|>assistant<|channel|>final<|message|>Below is a minimal, selfβcontained quickβsort implementation in a few common languages.
Feel free to copyβpaste the snippet that matches your stack, or use it as a template and adapt it to your needs.
---
## QuickβSort β Concept
1. **Choose a pivot** β usually the first element (or median of three, etc.).
2. **Partition** the array into two subβarrays:
* elements `< pivot`
* elements `>= pivot` (or `> pivot` if you want to avoid duplicates)
3. **Recursively sort** the two subβarrays.
4. **Concatenate** the sorted left part, the pivot, and the sorted right part.
The algorithm is *inβplace* (no extra array for the whole list) and runs in average \(O(n \log n)\), worstβcase \(O(n^2)\) if the pivot is poorly chosen.
---
## 1. Python (inβplace)
```python
def quick_sort(arr, left=0, right=None):
"""
Sorts `arr` in place using the QuickβSort algorithm.
"""
if right is None:
right = len(arr) - 1
def _partition(lo, hi):
# choose the first element as pivot
pivot = arr[lo]
i, j = lo + 1, hi
while True:
while i <= hi and arr[i] < pivot:
i += 1
while j >= lo + 1 and arr[j] > pivot:
j -= 1
if i >= j:
break
arr[i], arr[j] = arr[j], arr[i]
# place pivot in its final position
arr[lo], arr[j] = arr[j], arr[lo]
return j
if left < right:
p = _partition(left, right)
quick_sort(arr, left, p - 1)
quick_sort(arr, p + 1, right)
# ---- Example ----------------------------------------------------
data = [3, 6, 8, 10, 1, 2, 1]
quick_sort(data)
print(data) # -> [1, 1, 2, 3, 6, 8, 10]
```
**Notes**
* The helper `_partition` returns the final index of the pivot.
* The algorithm is *stable only if you change the comparison* to `<=` or `>=` depending on the ordering you need.
* For very large lists you may want to switch to a nonβrecursive implementation to avoid hitting Pythonβs recursion depth limit.
---
## 2. C++ (inβplace, STLβlike)
```cpp
#include <vector>
#include <algorithm> // for std::swap
template<typename T>
void quick_sort(std::vector<T>& a, int left = 0, int right = -1)
{
if (right == -1) right = static_cast<int>(a.size()) - 1;
auto partition = [&](int lo, int hi) -> int {
T pivot = a[lo];
int i = lo + 1, j = hi;
while (true) {
while (i <= hi && a[i] < pivot) ++i;
while (j >= lo + 1 && a[j] > pivot) --j;
if (i >= j) break;
std::swap(a[i], a[j]);
}
std::swap(a[lo], a[j]); // pivot in place
return j;
};
if (left < right) {
int p = partition(left, right);
quick_sort(a, left, p - 1);
quick_sort(a, p + 1, right);
}
}
// ---- Example ----------------------------------------------------
int main() {
std::vector<int> v{3, 6, 8, 10, 1, 2, 1};
quick_sort(v);
for (int x : v) std::cout << x << ' ';
// Output: 1 1 2 3 6 8 10
}
```
---
## 3. Java (inβplace)
```java
public static <T extends Comparable<? super T>> void quickSort(T[] a) {
quickSort(a, 0, a.length - 1);
}
private static <T extends Comparable<? super T>> void quickSort(T[] a,
int left, int right) {
if (left >= right) return;
int pivotIdx = partition(a, left, right);
quickSort(a, left, pivotIdx - 1);
quickSort(a, pivotIdx + 1, right);
}
private static <T extends Comparable<? super T>> int partition(T[] a,
int left, int right) {
T pivot = a[left];
int i = left + 1, j = right;
while (true) {
while (i <= right && a[i].compareTo(pivot) < 0) i++;
while (j >= left + 1 && a[j].compareTo(pivot) > 0) j--;
if (i >= j) break;
T tmp = a[i]; a[i] = a[j]; a[j] = tmp;
}
// put pivot into final place
T tmp = a[left]; a[left] = a[j]; a[j] = tmp;
return j;
}
```
---
## 4. JavaScript (inβplace)
```javascript
function quickSort(arr, left = 0, right = arr.length - 1) {
if (left >= right) return;
const pivot = arr[left];
let i = left + 1, j = right;
while (true) {
while (i <= right && arr[i] < pivot) i++;
while (j >= left + 1 && arr[j] > pivot) j--;
if (i >= j) break;
[arr[i], arr[j]] = [arr[j], arr[i]];
}
[arr[left], arr[j]] = [arr[j], arr[left]]; // pivot in place
quickSort(arr, left, j - 1);
quickSort(arr, j + 1, right);
}
// ---- Example ----------------------------------------------------
let data = [3, 6, 8, 10, 1, 2, 1];
quickSort(data);
console.log(data); // [1, 1, 2, 3, 6, 8, 10]
```
---
### QuickβSort Tips
| Problem | Fix |
|---------|-----|
| **Worstβcase O(nΒ²)** when the pivot is always the smallest/largest element | Pick the middle element or use medianβofβthree pivot. |
| **Stack overflow** on very deep recursion | Convert recursion to iteration (explicit stack) or switch to an iterative algorithm. |
| **Unstable sorting** | If stability matters, use a stable algorithm (e.g., mergeβsort) or add an index to each element and compare that as a tieβbreaker. |
| **Large duplicates** | Use βDutchβFlagβ partitioning that groups `< pivot`, `== pivot`, `> pivot`. |
---
### Final Word
Quickβsort is a classic divideβandβconquer algorithm that works well for averageβcase sorting.
The snippets above are short, inβplace, and can be dropped into most code bases.
Happy coding!
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:q4_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
- 90
4-bit
Model tree for Intel/gpt-oss-20b-gguf-q4ks-AutoRound
Base model
openai/gpt-oss-20b