Text Generation
Transformers
Safetensors
GGUF
MLX
English
qwen2
code
code-generation
qwen2.5-coder
ollama
llama.cpp
speculative-decoding
compact-invariant-distillation
mathematical-induction
36gb-ram
conversational
text-generation-inference
4-bit precision
Instructions to use nileshc90/apex-code-14b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nileshc90/apex-code-14b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nileshc90/apex-code-14b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nileshc90/apex-code-14b-instruct") model = AutoModelForCausalLM.from_pretrained("nileshc90/apex-code-14b-instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - MLX
How to use nileshc90/apex-code-14b-instruct 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("nileshc90/apex-code-14b-instruct") 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
- llama.cpp
How to use nileshc90/apex-code-14b-instruct 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 nileshc90/apex-code-14b-instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf nileshc90/apex-code-14b-instruct:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf nileshc90/apex-code-14b-instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf nileshc90/apex-code-14b-instruct: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 nileshc90/apex-code-14b-instruct:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf nileshc90/apex-code-14b-instruct:Q4_K_M
Use Docker
docker model run hf.co/nileshc90/apex-code-14b-instruct:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use nileshc90/apex-code-14b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nileshc90/apex-code-14b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-code-14b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nileshc90/apex-code-14b-instruct:Q4_K_M
- SGLang
How to use nileshc90/apex-code-14b-instruct 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-code-14b-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-code-14b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-code-14b-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-code-14b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nileshc90/apex-code-14b-instruct with Ollama:
ollama run hf.co/nileshc90/apex-code-14b-instruct:Q4_K_M
- Unsloth Desktop
- Pi
How to use nileshc90/apex-code-14b-instruct with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nileshc90/apex-code-14b-instruct"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "nileshc90/apex-code-14b-instruct" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use nileshc90/apex-code-14b-instruct with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "nileshc90/apex-code-14b-instruct"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "nileshc90/apex-code-14b-instruct" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nileshc90/apex-code-14b-instruct", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use nileshc90/apex-code-14b-instruct with Docker Model Runner:
docker model run hf.co/nileshc90/apex-code-14b-instruct:Q4_K_M
- Lemonade
How to use nileshc90/apex-code-14b-instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nileshc90/apex-code-14b-instruct:Q4_K_M
Run and chat with the model
lemonade run user.apex-code-14b-instruct-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use nileshc90/apex-code-14b-instruct 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 "nileshc90/apex-code-14b-instruct"
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 nileshc90/apex-code-14b-instruct
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nileshc90/apex-code-14b-instruct with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nileshc90/apex-code-14b-instruct"
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 "nileshc90/apex-code-14b-instruct" \ --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"
docs: add comprehensive model card and Ollama integration details
Browse files
README.md
CHANGED
|
@@ -35,7 +35,7 @@ By pairing **Qwen2.5-Coder-14B-Instruct** with **Compact Invariant Distillation
|
|
| 35 |
ApexCode v2.0 incorporates **Compact Invariant Distillation (CID)**, synthesizing native mathematical induction, DeepSeek-R1 semantic variable binding (*arXiv:2501.12948*), and bounded cognitive reasoning (*arXiv:2604.10739* "When More Thinking Hurts").
|
| 36 |
|
| 37 |
### Key Innovations:
|
| 38 |
-
- **Bounded Invariant Reasoning (
|
| 39 |
- **Zero Contamination Single-Pass Evaluation**: Evaluated strictly blind on the hardest 25 LiveCodeBench failure problems without test-time execution feedback or sample probing.
|
| 40 |
- **Breakthrough Score**: Jumped from **32.0% straight to 72.0% (18 / 25 Passed)**!
|
| 41 |
- **Zero Swap Churn**: Runs natively in Apple Silicon Unified Memory with **0.00 MB swap churn**.
|
|
@@ -143,9 +143,9 @@ Standard generative coding often suffers from two hidden failure modes: sampling
|
|
| 143 |
- Code generation is fundamentally mathematical and discrete. Unlike conversational creative writing, sampling tokens with `temperature > 0.0` introduces variance that leads to hallucinated shortcuts and off-by-one errors.
|
| 144 |
- In our benchmark, switching from `temp = 0.2` to greedy `temp = 0.0` resolved algorithmic logic errors on problems like `1873_B` (switching from a flawed non-9 heuristic to a mathematically sound search) and `1899_A` (eliminating inverted modulo branching).
|
| 145 |
- **Calibrated Min-P Sampling (`min_p = 0.05`)**:
|
| 146 |
-
- When candidate diversification is required, Min-P truncates the low-probability tail dynamically based on top-token confidence, preventing syntax degeneration without the rigidity of static top-
|
| 147 |
- **Production Fast I/O Scaffolding**:
|
| 148 |
-
- Automatically injects high-throughput bulk tokenization (`sys.stdin.read().split()`) to eliminate Time-Limit-Exceeded (TLE) timeouts on large inputs (
|
| 149 |
- Sets deep recursion limits (`sys.setrecursionlimit(300_000)`) for tree traversals and graph algorithms.
|
| 150 |
- Enforces `if __name__ == '__main__':` isolation, ensuring LeetCode/class-based evaluators can import `Solution` cleanly without executing top-level I/O.
|
| 151 |
|
|
@@ -192,9 +192,9 @@ All code execution verification during benchmarking runs inside an isolated, war
|
|
| 192 |
### 5. Recursive Multi-Agent Epistemic Swarm (RecursiveMAS & HippoRAG)
|
| 193 |
|
| 194 |
To solve complex competitive programming and enterprise refactoring tasks on par with Claude 3.5/3.7 Sonnet:
|
| 195 |
-
- **Smart Decision Override (`scripts/recursive_task_scheduler.py`)**: Computes task complexity
|
| 196 |
- **CAR Task Engine (`scripts/car_analyzer.py`)**: Distinguishes **Type A surface defects** (single-shot AST repair) from **Type B root-cause missing info** (escalates to RecursiveMAS with an epistemic ticket).
|
| 197 |
-
- **Shared Epistemic Memory Bus (`scripts/epistemic_cache.py`)**: In-memory vector similarity cache (
|
| 198 |
- **Zero-Assumption Invariant**: Subagents are strictly bounded to their assigned micro-task and forbidden from guessing unstated specifications, emitting `BLOCKED_MISSING_INFO` tickets.
|
| 199 |
- **Empirical LiveCodeBench Verification**: Evaluated on LiveCodeBench (`1873_B: B. Good Kid`) with 100% Pass@1 (13/13 test cases passed in 11.45s, 0.0 MB memory swap).
|
| 200 |
|
|
|
|
| 35 |
ApexCode v2.0 incorporates **Compact Invariant Distillation (CID)**, synthesizing native mathematical induction, DeepSeek-R1 semantic variable binding (*arXiv:2501.12948*), and bounded cognitive reasoning (*arXiv:2604.10739* "When More Thinking Hurts").
|
| 36 |
|
| 37 |
### Key Innovations:
|
| 38 |
+
- **Bounded Invariant Reasoning (under 150 tokens)**: Restricts `<think> ... </think>` reasoning to at most 2 dense invariant sentences, permanently eliminating the "preamble trap" (verbose text generation leading to context truncation).
|
| 39 |
- **Zero Contamination Single-Pass Evaluation**: Evaluated strictly blind on the hardest 25 LiveCodeBench failure problems without test-time execution feedback or sample probing.
|
| 40 |
- **Breakthrough Score**: Jumped from **32.0% straight to 72.0% (18 / 25 Passed)**!
|
| 41 |
- **Zero Swap Churn**: Runs natively in Apple Silicon Unified Memory with **0.00 MB swap churn**.
|
|
|
|
| 143 |
- Code generation is fundamentally mathematical and discrete. Unlike conversational creative writing, sampling tokens with `temperature > 0.0` introduces variance that leads to hallucinated shortcuts and off-by-one errors.
|
| 144 |
- In our benchmark, switching from `temp = 0.2` to greedy `temp = 0.0` resolved algorithmic logic errors on problems like `1873_B` (switching from a flawed non-9 heuristic to a mathematically sound search) and `1899_A` (eliminating inverted modulo branching).
|
| 145 |
- **Calibrated Min-P Sampling (`min_p = 0.05`)**:
|
| 146 |
+
- When candidate diversification is required, Min-P truncates the low-probability tail dynamically based on top-token confidence, preventing syntax degeneration without the rigidity of static top-k.
|
| 147 |
- **Production Fast I/O Scaffolding**:
|
| 148 |
+
- Automatically injects high-throughput bulk tokenization (`sys.stdin.read().split()`) to eliminate Time-Limit-Exceeded (TLE) timeouts on large inputs (N = 10^5).
|
| 149 |
- Sets deep recursion limits (`sys.setrecursionlimit(300_000)`) for tree traversals and graph algorithms.
|
| 150 |
- Enforces `if __name__ == '__main__':` isolation, ensuring LeetCode/class-based evaluators can import `Solution` cleanly without executing top-level I/O.
|
| 151 |
|
|
|
|
| 192 |
### 5. Recursive Multi-Agent Epistemic Swarm (RecursiveMAS & HippoRAG)
|
| 193 |
|
| 194 |
To solve complex competitive programming and enterprise refactoring tasks on par with Claude 3.5/3.7 Sonnet:
|
| 195 |
+
- **Smart Decision Override (`scripts/recursive_task_scheduler.py`)**: Computes task complexity score in range [0.0, 1.0]. Low-entropy tasks (score < 0.55) execute via **System 1 Fast-Path** (<500ms, 0 subagents). High-entropy tasks escalate to **System 2 RecursiveMAS** (DAG decomposition down to depth N).
|
| 196 |
- **CAR Task Engine (`scripts/car_analyzer.py`)**: Distinguishes **Type A surface defects** (single-shot AST repair) from **Type B root-cause missing info** (escalates to RecursiveMAS with an epistemic ticket).
|
| 197 |
+
- **Shared Epistemic Memory Bus (`scripts/epistemic_cache.py`)**: In-memory vector similarity cache (>= 0.92 threshold) eliminates duplicate tool calls. HippoRAG Knowledge Graph extracts multi-hop context via **Personalized PageRank (PPR)**.
|
| 198 |
- **Zero-Assumption Invariant**: Subagents are strictly bounded to their assigned micro-task and forbidden from guessing unstated specifications, emitting `BLOCKED_MISSING_INFO` tickets.
|
| 199 |
- **Empirical LiveCodeBench Verification**: Evaluated on LiveCodeBench (`1873_B: B. Good Kid`) with 100% Pass@1 (13/13 test cases passed in 11.45s, 0.0 MB memory swap).
|
| 200 |
|