Instructions to use piotrjanik/ocm-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use piotrjanik/ocm-coder with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir ocm-coder piotrjanik/ocm-coder
- llama-cpp-python
How to use piotrjanik/ocm-coder with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="piotrjanik/ocm-coder", filename="ocm-coder-q4_k_m.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use piotrjanik/ocm-coder with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf piotrjanik/ocm-coder:Q4_K_M # Run inference directly in the terminal: llama-cli -hf piotrjanik/ocm-coder:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf piotrjanik/ocm-coder:Q4_K_M # Run inference directly in the terminal: llama-cli -hf piotrjanik/ocm-coder: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 piotrjanik/ocm-coder:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf piotrjanik/ocm-coder: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 piotrjanik/ocm-coder:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf piotrjanik/ocm-coder:Q4_K_M
Use Docker
docker model run hf.co/piotrjanik/ocm-coder:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use piotrjanik/ocm-coder with Ollama:
ollama run hf.co/piotrjanik/ocm-coder:Q4_K_M
- Unsloth Studio new
How to use piotrjanik/ocm-coder 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 piotrjanik/ocm-coder 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 piotrjanik/ocm-coder to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for piotrjanik/ocm-coder to start chatting
- Pi new
How to use piotrjanik/ocm-coder with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "piotrjanik/ocm-coder"
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": "piotrjanik/ocm-coder" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use piotrjanik/ocm-coder 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 "piotrjanik/ocm-coder"
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 piotrjanik/ocm-coder
Run Hermes
hermes
- Docker Model Runner
How to use piotrjanik/ocm-coder with Docker Model Runner:
docker model run hf.co/piotrjanik/ocm-coder:Q4_K_M
- Lemonade
How to use piotrjanik/ocm-coder with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull piotrjanik/ocm-coder:Q4_K_M
Run and chat with the model
lemonade run user.ocm-coder-Q4_K_M
List all available models
lemonade list
Upload folder using huggingface_hub
Browse files- 0000200_adapters.safetensors +3 -0
- 0000400_adapters.safetensors +3 -0
- 0000600_adapters.safetensors +3 -0
- 0000800_adapters.safetensors +3 -0
- 0001000_adapters.safetensors +3 -0
- README.md +22 -0
- adapter_config.json +40 -0
- adapters.safetensors +3 -0
0000200_adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54344b95471da867774e2667b5f058750fd4213dd9f056ce13171e01c37d71ac
|
| 3 |
+
size 46161566
|
0000400_adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65e15679fae571bdc480bf0a99d91b74ea0fe17f484886fc9882ab16ff8c03e3
|
| 3 |
+
size 46161566
|
0000600_adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e66f568b437464e6c0690b5870aeef4591c19318230b1767241568afe535179f
|
| 3 |
+
size 46161566
|
0000800_adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f51c73e4c85f71e6ff46610aee62b248fdae7c272dc5bce08d9b2e600c6f9c6f
|
| 3 |
+
size 46161566
|
0001000_adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f33565f4f7926e9f58963de97e0bc08f58ed33283b3db2e5b8b919157be80ea
|
| 3 |
+
size 46161566
|
README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: mlx-community/Qwen2.5-Coder-32B-Instruct-4bit
|
| 3 |
+
library_name: mlx
|
| 4 |
+
tags: [mlx, lora, ocm, oci, go]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# ocm-coder
|
| 8 |
+
|
| 9 |
+
LoRA adapters fine-tuned on the Open Component Model (OCM) and OCI specification ecosystem.
|
| 10 |
+
|
| 11 |
+
**Base model:** [mlx-community/Qwen2.5-Coder-32B-Instruct-4bit](https://huggingface.co/mlx-community/Qwen2.5-Coder-32B-Instruct-4bit)
|
| 12 |
+
|
| 13 |
+
## Usage
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
from mlx_lm import load, generate
|
| 17 |
+
|
| 18 |
+
model, tokenizer = load(
|
| 19 |
+
"mlx-community/Qwen2.5-Coder-32B-Instruct-4bit",
|
| 20 |
+
adapter_path="piotrjanik/ocm-coder",
|
| 21 |
+
)
|
| 22 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"adapter_path": "output/adapters",
|
| 3 |
+
"batch_size": 4,
|
| 4 |
+
"config": "output/lora_train_config.yaml",
|
| 5 |
+
"data": "output/mlx_data",
|
| 6 |
+
"fine_tune_type": "lora",
|
| 7 |
+
"grad_accumulation_steps": 1,
|
| 8 |
+
"grad_checkpoint": false,
|
| 9 |
+
"iters": 1000,
|
| 10 |
+
"learning_rate": 1e-05,
|
| 11 |
+
"lora_parameters": {
|
| 12 |
+
"dropout": 0.0,
|
| 13 |
+
"rank": 8,
|
| 14 |
+
"scale": 10.0
|
| 15 |
+
},
|
| 16 |
+
"lr_schedule": null,
|
| 17 |
+
"mask_prompt": false,
|
| 18 |
+
"max_seq_length": 4096,
|
| 19 |
+
"model": "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit",
|
| 20 |
+
"num_layers": 16,
|
| 21 |
+
"optimizer": "adam",
|
| 22 |
+
"optimizer_config": {
|
| 23 |
+
"adam": {},
|
| 24 |
+
"adamw": {},
|
| 25 |
+
"muon": {},
|
| 26 |
+
"sgd": {},
|
| 27 |
+
"adafactor": {}
|
| 28 |
+
},
|
| 29 |
+
"project_name": null,
|
| 30 |
+
"report_to": null,
|
| 31 |
+
"resume_adapter_file": null,
|
| 32 |
+
"save_every": 200,
|
| 33 |
+
"seed": 42,
|
| 34 |
+
"steps_per_eval": 200,
|
| 35 |
+
"steps_per_report": 10,
|
| 36 |
+
"test": false,
|
| 37 |
+
"test_batches": 500,
|
| 38 |
+
"train": true,
|
| 39 |
+
"val_batches": 25
|
| 40 |
+
}
|
adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f33565f4f7926e9f58963de97e0bc08f58ed33283b3db2e5b8b919157be80ea
|
| 3 |
+
size 46161566
|