utils.py 1.02 KB
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3

4
from typing import Optional
5
6
7
8
9
10

from typing_extensions import TypedDict


class ServerConfig(TypedDict, total=False):
    model: str
11
    arguments: list[str]
12
13
14
15
16
    system_prompt: Optional[str]
    supports_parallel: Optional[bool]
    supports_rocm: Optional[bool]


17
ARGS: list[str] = ["--max-model-len", "1024"]
18

19
CONFIGS: dict[str, ServerConfig] = {
20
    "mistral": {
21
        "model": "mistralai/Mistral-7B-Instruct-v0.3",
22
        "arguments": [
23
24
25
            "--tokenizer-mode",
            "mistral",
            '--ignore-patterns="consolidated.safetensors"',
26
        ],
27
        "system_prompt": "You are a helpful assistant with access to tools. If a tool"
28
29
30
        " that you have would be helpful to answer a user query, "
        "call the tool. Otherwise, answer the user's query directly "
        "without calling a tool. DO NOT CALL A TOOL THAT IS IRRELEVANT "
31
        "to the user's question - just respond to it normally.",
32
33
    },
}