Instructions to use mindsofchaos/codeoptics-coder-3b-v3-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mindsofchaos/codeoptics-coder-3b-v3-1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M # Run inference directly in the terminal: llama cli -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M # Run inference directly in the terminal: llama cli -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Use Docker
docker model run hf.co/mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with Ollama:
ollama run hf.co/mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
- Unsloth Desktop
- Pi
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with Docker Model Runner:
docker model run hf.co/mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
- Lemonade
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Run and chat with the model
lemonade run user.codeoptics-coder-3b-v3-1-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
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:9931/v1 hermes config set model.default mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mindsofchaos/codeoptics-coder-3b-v3-1 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "mindsofchaos/codeoptics-coder-3b-v3-1:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
File size: 6,210 Bytes
0410d58 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# CodeOptics-Coder v3.5: Hybrid Dual-Mode Benchmark\n",
"### Empirical Evaluation on Tesla T4 GPU (Kaggle)\n",
"\n",
"**Dual-Mode Architecture**:\n",
"- **Mode 1 (Fast-Path Reflexive)**: Direct synthesis without scratchpad overhead for pure functional & algorithmic tasks (HumanEval, string/math scripts).\n",
"- **Mode 2 (Deep Second-Order Architect)**: Full 4-part invariant scratchpad for Concurrency, Thread-Safety, State Invariants, and Classes (CEB-15, ClassEval).\n",
"- **Layer 0 (Compile-Time Hygiene)**: Automatic typing & standard library import injection.\n",
"- **Layer 4 (Actor-Critic Self-Healing)**: Traceback compiler feedback for functions and multi-method classes."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Cell 1: Hardware Preflight & Ollama GPU Setup\n",
"import os, sys, time, subprocess, urllib.request\n",
"\n",
"print('=' * 75)\n",
"print('[1/4] Hardware Preflight & Ollama GPU Setup')\n",
"print('=' * 75)\n",
"\n",
"# Kill any old daemon and install required GPU detection utilities\n",
"subprocess.run('pkill -9 ollama', shell=True)\n",
"subprocess.run('apt-get update -y && apt-get install -y pciutils zstd', shell=True, check=True)\n",
"subprocess.run('curl -fsSL https://ollama.com/install.sh | sh', shell=True, check=True)\n",
"\n",
"# Launch Ollama background daemon on GPU\n",
"subprocess.Popen(['ollama', 'serve'], stdout=open('/tmp/ollama.log', 'w'), stderr=subprocess.STDOUT)\n",
"for _ in range(15):\n",
" time.sleep(1)\n",
" try:\n",
" urllib.request.urlopen('http://127.0.0.1:11434/api/tags', timeout=2)\n",
" print('[+] Ollama daemon active and listening on Tesla T4 GPU!')\n",
" break\n",
" except Exception:\n",
" pass\n",
"\n",
"subprocess.run(['nvidia-smi'], check=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Cell 2: Register Model in Ollama with Stop Tokens\n",
"print('=' * 75)\n",
"print('[2/4] Registering Model in Ollama')\n",
"print('=' * 75)\n",
"\n",
"gguf_path = '/kaggle/working/codeoptic-coder-v3.1-q4_k_m.gguf'\n",
"if not os.path.exists(gguf_path):\n",
" for alt in ['/tmp/codeoptic-coder-v3.1-q4_k_m.gguf', 'codeoptic-coder-v3.1-q4_k_m.gguf']:\n",
" if os.path.exists(alt):\n",
" gguf_path = os.path.abspath(alt)\n",
" break\n",
"\n",
"if not os.path.exists(gguf_path):\n",
" print('[*] Downloading GGUF from Hugging Face...')\n",
" gguf_url = 'https://huggingface.co/mindsofchaos/codeoptics-coder-3b-v3-1/resolve/main/codeoptic-coder-v3.1-q4_k_m.gguf'\n",
" subprocess.run(['wget', '-q', '--show-progress', gguf_url, '-O', gguf_path], check=True)\n",
"\n",
"modelfile = f'''FROM {gguf_path}\n",
"PARAMETER temperature 0.1\n",
"PARAMETER top_p 0.85\n",
"PARAMETER num_ctx 8192\n",
"PARAMETER num_predict 2048\n",
"PARAMETER stop \"<|im_end|>\"\n",
"PARAMETER stop \"<|im_start|>\"\n",
"PARAMETER stop \"<|endoftext|>\"\n",
"'''\n",
"with open('/tmp/Modelfile.v3_5', 'w') as f:\n",
" f.write(modelfile)\n",
"\n",
"subprocess.run(['ollama', 'create', 'codeoptic-coder:v3.1', '-f', '/tmp/Modelfile.v3_5'], check=True)\n",
"print('[+] Model registered in Ollama successfully!')\n",
"\n",
"# Quick sanity check\n",
"t0 = time.time()\n",
"res = subprocess.run(['ollama', 'run', 'codeoptic-coder:v3.1', 'Output: print(\"READY\")'], capture_output=True, text=True)\n",
"print(f'[+] Sanity check speed: {time.time()-t0:.2f}s | Output: {res.stdout.strip()[:60]}')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Cell 3: Pull and Unpack CodeOptics v3.5 Benchmark Suite\n",
"print('=' * 75)\n",
"print('[3/4] Pulling CodeOptics v3.5 Hybrid Suite')\n",
"print('=' * 75)\n",
"\n",
"url = 'https://huggingface.co/mindsofchaos/codeoptics-coder-3b-v3-1/resolve/main/codeoptics_benchmark_suite.tar.gz'\n",
"subprocess.run(['wget', '-q', url, '-O', '/tmp/codeoptics_benchmark_suite.tar.gz'], check=True)\n",
"subprocess.run(['tar', '-xzf', '/tmp/codeoptics_benchmark_suite.tar.gz', '-C', '/kaggle/working/'], check=True)\n",
"print('[+] CodeOptics v3.5 Hybrid Engine & Runners unpacked in /kaggle/working/codeoptics/!')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Cell 4: Execute the Full Hybrid Dual-Mode Benchmark Suite\n",
"import os, sys, time, subprocess\n",
"\n",
"print('=' * 75)\n",
"print('[4/4] Executing Hybrid Dual-Mode Benchmark Suite (v3.5)')\n",
"print('=' * 75)\n",
"\n",
"os.chdir('/kaggle/working')\n",
"t_start = time.time()\n",
"subprocess.run([sys.executable, '-u', 'codeoptics/benchmark/hybrid_runner_v3_5.py', 'codeoptic-coder:v3.1'], check=True)\n",
"print(f'\\n[SUCCESS] Entire Hybrid Benchmark Suite completed in {time.time() - t_start:.1f}s!')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
} |