/ Модель

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

Контекст
32 768 токенов
Параметры
1,5 млрд
Лицензия
Своя лицензия
Архитектура
qwen2 · dense
Базовая модель
Qwen2.5-Coder-1.5B-Instruct
Библиотека
transformers
Опубликована
24 сен 2024

Arch-Function-1.5B

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

Дообученная компактная модель Qwen для выбора функций и формирования вызовов API по запросам на естественном языке.

320скачиваний за 30 дней18лайковвеса обновлены2 апр 2026

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Arch-Function-1.5B — компактная языковая модель компании Katanemo, предназначенная для вызова функций и взаимодействия с API. Она дообучена на базе Qwen/Qwen2.5-Coder-1.5B-Instruct и использует плотную архитектуру Qwen2 с 1,5 млрд параметров. Модель принимает текстовые инструкции и описания функций, определяет подходящие функции и параметры и формирует результат вызова в JSON-подобном формате.

Модель рассчитана на сценарии, где приложение связывает запрос пользователя с API или серверными функциями, включая многошаговый диалог с передачей результатов выполнения функций обратно модели. Для вызова функций рекомендуется использовать формат промпта из карточки модели. Заявления о производительности и качестве приведены разработчиком; карточка не содержит подробных численных результатов в доступном тексте.

Контекстное окно составляет 32 768 токенов. В метаданных указан английский язык, библиотека Transformers и формат весов safetensors. Лицензия обозначена как other, поэтому условия использования следует сверить с лицензией в репозитории модели.

Сценарии применения

  • выбор API-функции по запросу пользователя
  • извлечение аргументов и обязательных параметров функции
  • формирование структурированного вызова функции
  • автоматизация взаимодействия с backend API
  • многошаговый диалог с передачей результатов выполнения функций

Ограничения

Для надёжного вызова функций рекомендуется использовать формат промпта из карточки модели. Лицензия указана как other, поэтому условия применения нужно проверить в репозитории.

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

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

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

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

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

Открыть на Hugging Face

katanemo/Arch-Function-1.5B

Overview

The Katanemo Arch-Function collection of large language models (LLMs) is a collection state-of-the-art (SOTA) LLMs specifically designed for function calling tasks. The models are designed to understand complex function signatures, identify required parameters, and produce accurate function call outputs based on natural language prompts. Achieving performance on par with GPT-4, these models set a new benchmark in the domain of function-oriented tasks, making them suitable for scenarios where automated API interaction and function execution is crucial.

In summary, the Katanemo Arch-Function collection demonstrates:

  • State-of-the-art performance in function calling
  • Accurate parameter identification and suggestion, even in ambiguous or incomplete inputs
  • High generalization across multiple function calling use cases, from API interactions to automated backend tasks.
  • Optimized low-latency, high-throughput performance, making it suitable for real-time, production environments.

Arch-Function is the core LLM used in then open source Arch Gateway to seamlessly integrate user prompts with developers APIs

Key Features

Training Details

Katanemo Arch-Function collection is built on top of the Qwen 2.5. A blog with technical details leading to our models will be published soon.

Performance Benchmarks

We evaluate Katanemo Arch-Function series on the Berkeley Function-Calling Leaderboard (BFCL). We compare with commonly-used models and the results (as of Oct 21st, 2024) are shwon below. For each model family, we select the one with the highest rank.

Requirements

The code of Arch-Function-1.5B has been in the Hugging Face transformers library and we advise you to install latest version:

pip install transformers>=4.37.0

How to use

We use the following example to illustrate how to use our model to perform function calling tasks. Please note that, our model works best with our provided prompt format. It allows us to extract JSON output that is similar to the function-calling mode of ChatGPT.

Single Turn Example

import json
from typing import Any, Dict, List
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "katanemo/Arch-Function-1.5B"
model = AutoModelForCausalLM.from_pretrained(
    model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Please use our provided prompt for best performance
TASK_PROMPT = """
You are a helpful assistant.
""".strip()

TOOL_PROMPT = """
# Tools

You may call one or more functions to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
{tool_text}
</tools>
""".strip()

FORMAT_PROMPT = """
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
""".strip()

# Define available tools
get_weather_api = {
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get the current weather for a location",
        "parameters": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "str",
                    "description": "The city and state, e.g. San Francisco, New York",
                },
                "unit": {
                    "type": "str",
                    "enum": ["celsius", "fahrenheit"],
                    "description": "The unit of temperature to return",
                },
            },
            "required": ["location"],
        },
    },
}

openai_format_tools = [get_weather_api]


def convert_tools(tools: List[Dict[str, Any]]):
    return "\n".join([json.dumps(tool) for tool in tools])

# Helper function to create the system prompt for our model
def format_prompt(tools: List[Dict[str, Any]]):
    tool_text = convert_tools(tools)

    return (
        TASK_PROMPT
        + "\n\n"
        + TOOL_PROMPT.format(tool_text=tool_text)
        + "\n\n"
        + FORMAT_PROMPT
        + "\n"
    )


system_prompt = format_prompt(openai_format_tools)

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": "What is the weather in Seattle?"},
]

inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)

outputs = model.generate(
    inputs,
    max_new_tokens=512,
    do_sample=False,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
)

response = tokenizer.decode(outputs[0][len(inputs[0]) :], skip_special_tokens=True)
print(response)

Then you should be able to see the following output string in JSON format:

<tool_call>
{"name": "get_weather", "arguments": {"location": "Seattle"}}
</tool_call>

Multi Turn Example

Upon getting results from functions, you can add it to the messages list as a user message and pass it to the model to get responses for users.

# Suppose we receive the following result from the function:
get_weather_api_result = {'name': 'get_weather', 'results': {'temperature': '62°', 'unit': 'fahrenheit'}}
execution_results = [get_weather_api_result]

def add_execution_results(messages: List[Dict[str, Any]], execution_results: List[Dict[str, Any]]):
    content = "\n".join([f"<tool_response>\n{json.dumps(result)}</tool_response>" for result in execution_results])
    messages.append({"role": "user", "content": content})
    return messages

messages = add_execution_results(messages, execution_results)

inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)

outputs = model.generate(
    inputs,
    max_new_tokens=512,
    do_sample=False,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
)

response = tokenizer.decode(outputs[0][len(inputs[0]) :], skip_special_tokens=True)
print(response)

Then you should be able to see the following output:

The current temperature in Seattle is 62 degrees in Fahrenheit.

License

Katanemo Arch-Function collection is distributed under the Katanemo license.

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

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

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen2ForCausalLM
Ревизия весов
269b01a

0 моделей