Text Generation
MLX
Safetensors
English
qwen3
computer-science
software-engineering
programming
mlx-lm
apple-silicon
4-bit precision
quantized
code
python
conversational
Instructions to use Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit"
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": "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit 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 "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit"
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 Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit
Run Hermes
hermes
- OpenClaw new
How to use Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit"
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:8080/v1 \ --custom-model-id "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
| language: | |
| - en | |
| license: apache-2.0 | |
| base_model: | |
| - Irfanuruchi/Qwen3-4B-Computer-Science | |
| pipeline_tag: text-generation | |
| library_name: mlx | |
| tags: | |
| - qwen3 | |
| - computer-science | |
| - software-engineering | |
| - programming | |
| - mlx | |
| - mlx-lm | |
| - apple-silicon | |
| - 4-bit | |
| - quantized | |
| - code | |
| - python | |
| - conversational | |
| # Qwen3-4B-Computer-Science-MLX-4bit | |
| ## Overview | |
| Qwen3-4B-Computer-Science-MLX-4bit is a 4-bit MLX conversion of | |
| **Qwen3-4B-Computer-Science** for inference on Apple Silicon. | |
| The model was converted from the original BF16 Safetensors release using | |
| `mlx-lm`. It is intended for local inference on supported Mac systems using | |
| the MLX framework. | |
| --- | |
| ## Model Information | |
| | Property | Value | | |
| |---|---| | |
| | Source model | Irfanuruchi/Qwen3-4B-Computer-Science | | |
| | Base architecture | Qwen3-4B | | |
| | Framework | MLX | | |
| | Quantization | 4-bit | | |
| | Quantization group size | 64 | | |
| | Effective bits per weight | 4.501 | | |
| | Weight format | Safetensors | | |
| | Primary platform | Apple Silicon | | |
| | Language | English | | |
| | License | Apache-2.0 | | |
| --- | |
| ## Training Data | |
| The source model was instruction-tuned using permissively licensed datasets. | |
| | Dataset | Configuration | License | | |
| |---|---|---| | |
| | HuggingFaceTB/smoltalk | smol-magpie-ultra | Apache-2.0 | | |
| | agentica-org/DeepCoder-Preview-Dataset | primeintellect | MIT | | |
| ### Dataset Size | |
| | Split | Samples | | |
| |---|---:| | |
| | Training | 60,989 | | |
| | Evaluation | 512 | | |
| --- | |
| ## Intended Use | |
| This model is intended for: | |
| - Software engineering | |
| - Programming assistance | |
| - Code generation | |
| - Debugging | |
| - Code review | |
| - Algorithm implementation | |
| - Computer science education | |
| - General technical reasoning | |
| --- | |
| ## Installation | |
| Install MLX-LM: | |
| ```bash | |
| python -m pip install mlx-lm | |
| ``` | |
| --- | |
| ## Usage | |
| ### Command Line | |
| ```bash | |
| mlx_lm.generate \ | |
| --model Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit \ | |
| --prompt "Write a Python function that returns the first n Fibonacci numbers." \ | |
| --max-tokens 200 | |
| ``` | |
| ### Python | |
| ```python | |
| from mlx_lm import generate, load | |
| model, tokenizer = load( | |
| "Irfanuruchi/Qwen3-4B-Computer-Science-MLX-4bit" | |
| ) | |
| response = generate( | |
| model, | |
| tokenizer, | |
| prompt="Write a Python function that returns the first n Fibonacci numbers.", | |
| max_tokens=200, | |
| ) | |
| print(response) | |
| ``` | |
| --- | |
| ## Conversion | |
| The model was converted from: | |
| ```text | |
| Irfanuruchi/Qwen3-4B-Computer-Science | |
| ``` | |
| Conversion configuration: | |
| | Parameter | Value | | |
| |---|---:| | |
| | Quantization enabled | Yes | | |
| | Quantization bits | 4 | | |
| | Quantization group size | 64 | | |
| | Effective bits per weight | 4.501 | | |
| --- | |
| ## Release Validation | |
| The release was validated locally on Apple Silicon. | |
| | Test | Result | | |
| |---|---| | |
| | MLX conversion | Passed | | |
| | Model loading | Passed | | |
| | Text generation | Passed | | |
| | Generation speed | 53.512 tokens/sec | | |
| | Peak memory | 2.356 GB | | |
| Performance measurements are from one local generation test and may vary by | |
| device, prompt, context length, and software version. | |
| --- | |
| ## Release Artifacts | |
| ```text | |
| model.safetensors | |
| model.safetensors.index.json | |
| config.json | |
| generation_config.json | |
| tokenizer.json | |
| tokenizer_config.json | |
| added_tokens.json | |
| special_tokens_map.json | |
| merges.txt | |
| vocab.json | |
| README.conversion.md | |
| SHA256SUMS | |
| LICENSE | |
| README.md | |
| ``` | |
| --- | |
| ## Integrity Verification | |
| Verify the downloaded files on macOS: | |
| ```bash | |
| shasum -a 256 -c SHA256SUMS | |
| ``` | |
| On Linux: | |
| ```bash | |
| sha256sum -c SHA256SUMS | |
| ``` | |
| --- | |
| ## Limitations | |
| - Quantization can affect output quality relative to the BF16 checkpoint. | |
| - The model may produce incorrect or incomplete code. | |
| - Generated code should be reviewed and tested before use. | |
| - Performance depends on the Apple Silicon device and available memory. | |
| - This release is intended for MLX-compatible systems. | |
| --- | |
| ## License | |
| The model is distributed under the Apache License 2.0. | |
| The source model is based on Qwen3-4B, which is also distributed under the | |
| Apache License 2.0. | |
| --- | |
| ## Acknowledgements | |
| - Alibaba Qwen Team | |
| - Apple MLX Team | |
| - Hugging Face | |
| - SmolTalk contributors | |
| - DeepCoder contributors | |
| --- | |
| ## Citation | |
| ```bibtex | |
| @software{uruci2026qwen3computersciencemlx, | |
| title={Qwen3-4B-Computer-Science-MLX-4bit}, | |
| author={Irfan Uruçi}, | |
| year={2026}, | |
| publisher={Hugging Face} | |
| } | |
| ``` | |