Instructions to use nileshc90/apex-phi-14b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nileshc90/apex-phi-14b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nileshc90/apex-phi-14b")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nileshc90/apex-phi-14b", device_map="auto") - MLX
How to use nileshc90/apex-phi-14b with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("nileshc90/apex-phi-14b") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use nileshc90/apex-phi-14b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nileshc90/apex-phi-14b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-phi-14b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nileshc90/apex-phi-14b
- SGLang
How to use nileshc90/apex-phi-14b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nileshc90/apex-phi-14b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-phi-14b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nileshc90/apex-phi-14b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-phi-14b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - MLX LM
How to use nileshc90/apex-phi-14b with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "nileshc90/apex-phi-14b" --prompt "Once upon a time"
- Docker Model Runner
How to use nileshc90/apex-phi-14b with Docker Model Runner:
docker model run hf.co/nileshc90/apex-phi-14b
- Atomic Chat
β‘ ApexPhi-14B: Dual-Edition Workstation Suite (Coder & Think)
Microsoft Phi-4 (14.7B) Architecture | Mathematical Invariants & Formal Proofs | Optimized for 36 GB Unified RAM
ποΈ Executive Overview
ApexPhi-14B delivers a specialized dual-edition intelligence architecture built on Microsoft Research's Phi-4 (14.7B), optimized for developer workstations and Apple Silicon Macs (M4 Max / M2 Max):
β‘ ApexPhi-Coder-14B:
- Specialized in high-precision algorithmic coding, AST-verified syntax, and type safety.
- Direct, deterministic execution with zero conversational fluff.
- Zero-Assumption Invariant: strict schema and boundary verification.
- Sampling:
temperature 0.2,top_p 0.95,min_p 0.04.
π§ ApexPhi-Think-14B:
- Specialized in deep mathematical theorem proving, combinatorial logic, and state-machine transitions.
- Employs formal step-by-step invariant derivations inside
<think> ... </think>before stating proofs or code. - Formal verification guardrails: mathematically audits parity, induction steps, and boundary states.
- Sampling:
temperature 0.6,top_p 0.95,min_p 0.05.
Both editions run within ~10.4 GB RAM (Q5_K_M) or ~8.9 GB RAM (Q4_K_M), leaving over 23 GB of free host RAM on a 36 GB workstation for IDEs, Docker, and developer tools with 0.00 MB swap churn.
π§ Why ApexPhi-14B as an Algorithmic Backbone?
- Unmatched Mathematical & Algorithmic Density:
- MATH-500: 84.8% (outperforms many 70B models).
- GPQA Diamond: 56.1% graduate-level scientific and algorithmic reasoning.
- Trained on high-density synthetic textbook reasoning data with multi-turn verification.
- Zero Non-Western Georestrictions:
- Developed in the United States by Microsoft Research under the permissive MIT License.
- Fully open weights for commercial and enterprise deployment.
- Dynamic Min-P Sampling Cutoff:
- Dynamically prunes low-probability hallucinated tail tokens relative to the top token's confidence, ensuring high logical coherence.
π» 36 GB Unified Memory Allocation
+--------------------------------------------------------------------------------+
| Total Unified System RAM: 36 GB |
+---------------------------------------------------+----------------------------+
| Active AI Runtime: ~11.0 GB | Host Headroom: ~25.0 GB |
| +---------------------------------------------+ | +----------------------+ |
| | ApexPhi-14B (Coder / Think) | | | macOS Kernel (3.5 GB)| |
| | ~10.4 GB (0.0 MB Swap Churn) | | +----------------------+ |
| +---------------------------------------------+ | | VS Code / IDE (2.5GB)| |
| | Q8_0 KV Cache Buffer (~0.6 GB) | | +----------------------+ |
| +---------------------------------------------+ | | Docker & Web (6.0 GB)| |
| | +----------------------+ |
| | | Build Cache (13.0 GB)| |
+---------------------------------------------------+----------------------------+
π 1-Click Run Commands
A. Run with Ollama
# 1. Run the High-Precision Algorithmic Coder Edition:
ollama run apex-phi-coder-14b
# 2. Run the Deep Mathematical Proof / Think Edition:
ollama run apex-phi-think-14b
B. High-Throughput Apple Silicon Metal GPU (MLX)
# Serves local OpenAI-compatible endpoint at http://127.0.0.1:8082/v1
bash scripts/serve_mlx_phi4.sh 8082
π οΈ Continue.dev & VS Code Tab Autocomplete Configuration
Add to your ~/.continue/config.json:
{
"models": [
{
"title": "ApexPhi-Coder-14B (High-Precision Algorithmic Coder)",
"provider": "ollama",
"model": "apex-phi-coder-14b",
"apiBase": "http://localhost:11434"
},
{
"title": "ApexPhi-Think-14B (Mathematical Proofs & CoT)",
"provider": "ollama",
"model": "apex-phi-think-14b",
"apiBase": "http://localhost:11434"
}
],
"tabAutocompleteModel": {
"title": "ApexPhi-Coder-14B Precision Autocomplete",
"provider": "ollama",
"model": "apex-phi-coder-14b",
"apiBase": "http://localhost:11434"
}
}
π Related Resources
- ApexCode-14B Model: huggingface.co/nileshc90/apex-code-14b-instruct
- ApexThink-14B Model: huggingface.co/nileshc90/apex-think-14b
- ApexMistral-22B Model: huggingface.co/nileshc90/apex-mistral-22b
- GitHub Repository: github.com/nileshchakraborty/apex-phi-14b
Model tree for nileshc90/apex-phi-14b
Base model
microsoft/phi-4