Skip to main content

Phi Model for DashAI

Project description

Phi Model Plugin for DashAI

This plugin integrates Microsoft's Phi language models into the DashAI framework using the llama.cpp backend. It provides a lightweight, efficient text generation system with support for quantized GGUF models.

Included Models

1. Phi-3 Mini 4K Instruct

  • 3.8B parameter lightweight model from the Phi-3 family
  • Designed for high-quality output with strong reasoning abilities
  • Trained on synthetic and filtered public datasets
  • Fine-tuned with supervised techniques and direct preference optimization
  • Based on microsoft/Phi-3-mini-4k-instruct-gguf
  • Uses GGUF file: Phi-3-mini-4k-instruct-q4.gguf

2. Phi-4

  • State-of-the-art open model developed by Microsoft Research
  • Trained on high-quality public domain content, academic books, and Q&A datasets
  • Emphasizes precise instruction-following and strong safety alignment
  • Based on microsoft/phi-4-gguf
  • Uses GGUF file: phi-4-IQ3_M.gguf

Both models use the GGUF format and are compatible with CPU and GPU inference.

Components

PhiModel

  • Implements the TextToTextGenerationTaskModel interface from DashAI
  • Uses the llama.cpp backend with GGUF support
  • Automatically loads the correct quantized model file based on the selected model
  • Performs chat-style completion with system/user/assistant messages

Features

  • Configurable text generation with:

    • max_tokens: Number of tokens to generate
    • temperature: Controls output randomness
    • frequency_penalty: Reduces repetition
    • context_window: Max tokens per forward pass
    • device: "cpu" or "gpu" (auto-detected)
  • Efficient memory usage with quantized GGUF format

  • Automatic model loading from Hugging Face

  • Compatible with chat-style prompts (role-based message format)

Model Parameters

Parameter Description Default
model_name Model ID from Hugging Face "microsoft/Phi-3-mini-4k-instruct-gguf"
max_tokens Maximum number of tokens to generate 100
temperature Sampling temperature (higher = more random) 0.7
frequency_penalty Penalizes repeated tokens to encourage diversity 0.1
context_window Maximum context window (tokens in prompt) 512
device Device for inference ("gpu" or "cpu") Auto-detected

Requirements

Notes

This plugin uses the GGUF format, introduced by the llama.cpp team in August 2023.
GGUF replaces the older GGML format and is optimized for fast inference and low memory usage.

Both Phi-3 Mini and Phi-4 models have undergone supervised fine-tuning and preference optimization to improve instruction adherence and safety.

⚠️ These models are designed for inference only and are not intended for fine-tuning.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dashai_phi_model_package-0.0.2.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dashai_phi_model_package-0.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file dashai_phi_model_package-0.0.2.tar.gz.

File metadata

File hashes

Hashes for dashai_phi_model_package-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f99ae114f856bc34560ad7c2f172802cfcb7fbb8acfc3e5c15643c54137028cd
MD5 a072a91aa156437b5e89d2c43932c131
BLAKE2b-256 059618f42d6f1e8c516c9ffaa4e030adff8fcbd31d1a08741d66a89e03fa4987

See more details on using hashes here.

File details

Details for the file dashai_phi_model_package-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dashai_phi_model_package-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b5f3c669da1a4506e5b319c30e307f9029ce29d5ad808d8a3e9fdf409f5e2ed
MD5 8e5a7747c0f5f7685580488aeaf053f8
BLAKE2b-256 39374245a057a451f637d49505ca9355c52bf4eadc3cbc2c5c30b22816afa39b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page