Instructions to use moelanoby/phi-3-M3-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moelanoby/phi-3-M3-coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="moelanoby/phi-3-M3-coder", trust_remote_code=True) 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("moelanoby/phi-3-M3-coder", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("moelanoby/phi-3-M3-coder", trust_remote_code=True, 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use moelanoby/phi-3-M3-coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moelanoby/phi-3-M3-coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moelanoby/phi-3-M3-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/moelanoby/phi-3-M3-coder
- SGLang
How to use moelanoby/phi-3-M3-coder 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 "moelanoby/phi-3-M3-coder" \ --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": "moelanoby/phi-3-M3-coder", "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 "moelanoby/phi-3-M3-coder" \ --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": "moelanoby/phi-3-M3-coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use moelanoby/phi-3-M3-coder with Docker Model Runner:
docker model run hf.co/moelanoby/phi-3-M3-coder
Download README.md from moelanoby/phi-3-M3-coder: direct link, hf CLI and curl.
- Browser
- Download file 5.15 kB
-
https://huggingface.co/moelanoby/phi-3-M3-coder/resolve/8a06689add76e71d42b6e613965d3be33b68a687/README.md
- Command line
-
hf download hf://moelanoby/phi-3-M3-coder@8a06689add76e71d42b6e613965d3be33b68a687/README.md
-
curl -L -o README.md https://huggingface.co/moelanoby/phi-3-M3-coder/resolve/8a06689add76e71d42b6e613965d3be33b68a687/README.md
language:
- ar
- en
- de
- fr
- pt
- pl
metrics:
- accuracy
base_model:
- microsoft/Phi-3-mini-4k-instruct
library_name: transformers
tags:
- code
M3-V2: A State-of-the-Art Commercial Language Model
M3-V2 is a state-of-the-art causal language model featuring a proprietary architecture that enables advanced reasoning and self-correction. This model is not open source and is available for commercial licensing.
The model achieves a groundbreaking 98.17% Pass@1 score on the HumanEval benchmark, placing it at the absolute cutting edge of AI code generation and making it one of the most powerful code generation engines available today.
Benchmark Performance
The benchmark results demonstrate a level of performance that significantly surpasses publicly available models.
Performance Comparison
| Model | HumanEval Pass@1 Score | Note |
|---|---|---|
| moelanoby/phi3-M3-V2 (This Model) | 95.12%/98.17%/98.56% | Commercial License and they are ordered with 0,1,2 self corrections with 1 being the default |
| GPT-4.5 / "Orion" | ~96.00% |
Projected (Late 2025) |
| Gemini 2.5 Pro | ~95.00% |
Projected (Late 2025) |
| Claude 4 | ~94.00% |
Projected (Late 2025) |
License and Terms of Use
This model is proprietary and is governed by the following custom terms. By accessing or using this model, you agree to be bound by these rules.
Architecture Non-Derivability: The underlying code and architectural design, including the
architecture.pyfile, are proprietary and represent a trade secret. You are strictly prohibited from reverse-engineering, copying, or integrating this architecture or its components into any other model or software.Commercial License Required: Access to and use of this model require a paid commercial license. Unauthorized use, distribution, or access is strictly forbidden and will be subject to legal action.
Ethical Use and Finetuning Restriction: You may not finetune, train, or adapt this model on any dataset intended to remove ethical safeguards, promote illegal acts, or generate uncensored content. The model must be used in accordance with safety and ethical best practices.
How to Get Access
This model is available for commercial use via a paid license.
To purchase a license and gain access to the model, please contact our licensing team:
Email: elanoby69@email.com
Website: ``
You will be provided with access credentials and usage instructions upon completion of the licensing agreement.
Technical Usage (For Licensed Users)
Note: The following instructions are for licensed users only. Running this code without a valid commercial license is a violation of the terms of use.
Installation
First, ensure you have the necessary libraries installed:
pip install torch transformers accelerate
Python Implementation
After gaining access, you can integrate the model into your application. You must use trust_remote_code=True for the proprietary architecture to load correctly.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Use the private model ID and token provided with your license
MODEL_ID = "moelanoby/phi3-M3-V2"
# AUTH_TOKEN = "YOUR_HF_ACCESS_TOKEN_HERE" # Required for private models
print("Loading tokenizer and model...")
tokenizer = AutoTokenizer.from_pretrained(
MODEL_ID,
trust_remote_code=True,
# token=AUTH_TOKEN
)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto",
# token=AUTH_TOKEN
)
print("Model loaded successfully.")
# --- Controlling the model's proprietary reasoning feature ---
# This feature is a key part of your license.
# Default is 1 pass.
try:
target_layer_path = "model.layers.15.mlp.gate_up_proj"
custom_layer = model
for part in target_layer_path.split('.'):
custom_layer = getattr(custom_layer, part)
custom_layer.num_correction_passes = 3
print(f"✅ Number of reasoning passes set to: {custom_layer.num_correction_passes}")
except AttributeError:
print("⚠️ Could not access the custom layer. The model will run with its default settings.")
# (Example generation code would follow here)
HUGE NOTES
- downside: the model might grow more incoherent and less accurate as you add more self corrections
- recommendations: you could use 1,2,3 self corrections if needed and 2 self corrections is the most recommended
Acknowledgements
- The base of this model utilizes the Phi-3 architecture developed by Microsoft.
- The benchmark results were obtained using the HumanEval dataset from OpenAI.
