/ Модель

Характеристики

Лицензия
Своя лицензия
Опубликована
28 фев 2025

Phi-4-mini-instruct-imatrix-GGUF

Генерация текстаТекст → текст15 профессий

duyntnet/Phi-4-mini-instruct-imatrix-GGUF — набор GGUF-квантизаций модели Phi-4-mini-instruct, разработанной Microsoft.

607скачиваний за 30 дней0лайковвеса обновлены28 фев 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель предназначена для генерации текста, диалогов, выполнения инструкций, рассуждений и сценариев с вызовом инструментов. Она ориентирована на локальный запуск через llama.cpp и совместимые клиенты, включая KoboldCPP, Ollama, text-generation-webui, Jan и GPT4All.

Модель является лёгкой и поддерживает контекст длиной до 128K токенов. Она обучалась на синтетических данных и отфильтрованных общедоступных веб-материалах с акцентом на плотные по рассуждениям данные; для улучшения следования инструкциям и безопасности применялись supervised fine-tuning и direct preference optimization. Указан английский язык, модальность — текстовая. Размер модели, конкретные параметры квантизации и архитектурные детали в README не приведены.

Для запуска требуется llama.cpp версии b4792 или новее либо совместимое программное обеспечение. Квантизация может снизить требования к ресурсам, но потенциально уступать исходной модели в точности; конкретные компромиссы зависят от варианта GGUF и не описаны. Лицензия указана как other, без дополнительных условий в представленном README.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Quantizations of https://huggingface.co/microsoft/Phi-4-mini-instruct

Note: you will need llama.cpp b4792 or later to run the model.

Inference Clients/UIs


From original readme

Phi-4-mini-instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.

📰 Phi-4-mini Microsoft Blog 📖 Phi-4-mini Technical Report 👩‍🍳 Phi Cookbook 🏡 Phi Portal 🖥️ Try It Azure, Huggingface

Phi-4: [mini-instruct | onnx]; multimodal-instruct;

Usage

Tokenizer

Phi-4-mini-instruct supports a vocabulary size of up to 200064 tokens. The tokenizer files already provide placeholder tokens that can be used for downstream fine-tuning, but they can also be extended up to the model's vocabulary size.

Input Formats

Given the nature of the training data, the Phi-4-mini-instruct model is best suited for prompts using specific formats. Below are the two primary formats:

Chat format

This format is used for general conversation and instructions:

<|system|>Insert System Message<|end|><|user|>Insert User Message<|end|><|assistant|>

Tool-enabled function-calling format

This format is used when the user wants the model to provide function calls based on the given tools. The user should provide the available tools in the system prompt, wrapped by <|tool|> and <|/tool|> tokens. The tools should be specified in JSON format, using a JSON dump structure. Example:

<|system|>You are a helpful assistant with some tools.<|tool|>[{"name": "get_weather_updates", "description": "Fetches weather updates for a given city using the RapidAPI Weather API.", "parameters": {"city": {"description": "The name of the city for which to retrieve weather information.", "type": "str", "default": "London"}}}]<|/tool|><|end|><|user|>What is the weather like in Paris today?<|end|><|assistant|>

Inference with vLLM

Requirements

List of required packages:

flash_attn==2.7.4.post1
torch==2.6.0
vllm>=0.7.2

Example

To perform inference using vLLM, you can use the following code snippet:

from vllm import LLM, SamplingParams

llm = LLM(model="microsoft/Phi-4-mini-instruct", trust_remote_code=True)

messages = [
    {"role": "system", "content": "You are a helpful AI assistant."},
    {"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
    {"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
    {"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
]

sampling_params = SamplingParams(
  max_tokens=500,
  temperature=0.0,
)

output = llm.chat(messages=messages, sampling_params=sampling_params)
print(output[0].outputs[0].text)

Inference with Transformers

Requirements

Phi-4 family has been integrated in the 4.49.0 version of transformers. The current transformers version can be verified with: pip list | grep transformers.

List of required packages:

flash_attn==2.7.4.post1
torch==2.6.0
transformers==4.49.0
accelerate==1.3.0

Phi-4-mini-instruct is also available in Azure AI Studio

Example

After obtaining the Phi-4-mini-instruct model checkpoints, users can use this sample code for inference.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
 
torch.random.manual_seed(0)

model_path = "microsoft/Phi-4-mini-instruct"

model = AutoModelForCausalLM.from_pretrained(
    model_path,
    device_map="auto",
    torch_dtype="auto",
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_path)
 
messages = [
    {"role": "system", "content": "You are a helpful AI assistant."},
    {"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
    {"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
    {"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
]
 
pipe = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
)
 
generation_args = {
    "max_new_tokens": 500,
    "return_full_text": False,
    "temperature": 0.0,
    "do_sample": False,
}
 
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

llama.cpp

Нельзя запустить

GGUF-модель ждёт проверки: нужно выбрать файл кванта под доступные GPU.

Ревизия весов
59f9347

0 моделей