Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

mlx-community
/
Phi-3-mini-4k-instruct-8bit

Text Generation
MLX
Safetensors
English
phi3
nlp
code
conversational
custom_code
Model card Files Files and versions
xet
Community
1

Instructions to use mlx-community/Phi-3-mini-4k-instruct-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use mlx-community/Phi-3-mini-4k-instruct-8bit 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("mlx-community/Phi-3-mini-4k-instruct-8bit")
    
    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
  • LM Studio
  • MLX LM

    How to use mlx-community/Phi-3-mini-4k-instruct-8bit with MLX LM:

    Generate or start a chat session
    # Install MLX LM
    uv tool install mlx-lm
    # Interactive chat REPL
    mlx_lm.chat --model "mlx-community/Phi-3-mini-4k-instruct-8bit"
    Run an OpenAI-compatible server
    # Install MLX LM
    uv tool install mlx-lm
    # Start the server
    mlx_lm.server --model "mlx-community/Phi-3-mini-4k-instruct-8bit"
    # Calling the OpenAI-compatible server with curl
    curl -X POST "http://localhost:8000/v1/chat/completions" \
       -H "Content-Type: application/json" \
       --data '{
         "model": "mlx-community/Phi-3-mini-4k-instruct-8bit",
         "messages": [
           {"role": "user", "content": "Hello"}
         ]
       }'
Phi-3-mini-4k-instruct-8bit
4.06 GB
Ctrl+K
Ctrl+K
  • 3 contributors
History: 6 commits
prince-canuma's picture
prince-canuma
depasquale's picture
depasquale
Update model (#1)
ea4c5f2 verified almost 2 years ago
  • .gitattributes
    1.52 kB
    initial commit about 2 years ago
  • README.md
    770 Bytes
    Update README.md about 2 years ago
  • config.json
    1.03 kB
    Update model (#1) almost 2 years ago
  • configuration_phi3.py
    11.2 kB
    Update model (#1) almost 2 years ago
  • model.safetensors
    4.06 GB
    xet
    Update model (#1) almost 2 years ago
  • model.safetensors.index.json
    32.7 kB
    Upload folder using huggingface_hub about 2 years ago
  • modeling_phi3.py
    73.2 kB
    Update model (#1) almost 2 years ago
  • sample_finetune.py
    6.4 kB
    Update model (#1) almost 2 years ago
  • special_tokens_map.json
    569 Bytes
    Update model (#1) almost 2 years ago
  • tokenizer.json
    1.84 MB
    Update model (#1) almost 2 years ago
  • tokenizer_config.json
    3.34 kB
    Update model (#1) almost 2 years ago