Skip to content

use

simple_chat(router, prompt, task_tag='generic', *, model=None)

Perform a simple chat interaction with the LLM via the router.

Example

from wintermute.ai.bootstrap import init_router from wintermute.ai.use import simple_chat router = init_router()

Default (Claude)

print(simple_chat(router, "Summarize: UART vs JTAG risks")) Here's a summary comparing the risks of UART vs JTAG:

UART (Universal Asynchronous Receiver/Transmitter):

  1. Lower security risk overall
  2. Limited access to system internals
  3. Typically only provides console access
  4. Can potentially expose sensitive information in debug output
  5. Easier to secure by disabling or removing headers

JTAG (Joint Test Action Group):

  1. Higher security risk
  2. Provides deep access to system internals
  3. Allows for full control of the processor and memory
  4. Can be used to extract firmware, modify code, and bypass security measures
  5. More challenging to fully secure, often requires physical fuses or permanent disabling

    DeepSeek (inference profile)

    print( ... simple_chat( ... router, ... "Summarize UART vs JTAG risks in 3 bullets", ... model="us.deepseek.r1-v1:0", ... ) ... )

  6. Access Level: UART exposes a serial console for command-line interaction, risking unauthorized system access, while JTAG provides deeper hardware control, enabling memory/firmware manipulation and security bypass.
  7. Exploitation Barrier: UART requires basic tools (e.g., USB-to-TTL) and minimal expertise, making it easier to exploit, whereas JTAG demands specialized tools and advanced knowledge, raising the entry barrier for attackers.
  8. Impact Severity: UART compromises may lead to configuration changes or log leaks, but JTAG breaches can result in full system control, firmware extraction, or intellectual property theft, posing a critical threat.

    Llama

    print( ... simple_chat( ... router, ... "Summarize UART vs JTAG risks in a One-liner", ... model="meta.llama3-8b-instruct-v1:0", ... ) ... ) UART (Universal Asynchronous Receiver-Transmitter) and JTAG (Joint Test Action Group) are both debugging interfaces, but UART is a more vulnerable and risky option due to its ability to be easily accessed and manipulated by an attacker, whereas JTAG is a more secure option due to its complexity and limited accessibility, making it a better choice for debugging and testing purposes.

Parameters:

Name Type Description Default
router Router

The Router instance to use for selecting the provider.

required
prompt str

The user prompt to send to the LLM.

required
task_tag str

A tag to categorize the task (default is "generic").

'generic'
model Optional[str]

An optional model name to use for the request.

None
Source code in wintermute/ai/use.py
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
def simple_chat(
    router: Router,
    prompt: str,
    task_tag: str = "generic",
    *,
    model: Optional[str] = None,
) -> str:
    """Perform a simple chat interaction with the LLM via the router.

    Example:
        >>> from wintermute.ai.bootstrap import init_router
        >>> from wintermute.ai.use import simple_chat
        >>> router = init_router()
        >>> # Default (Claude)
        >>> print(simple_chat(router, "Summarize: UART vs JTAG risks"))
        Here's a summary comparing the risks of UART vs JTAG:

        UART (Universal Asynchronous Receiver/Transmitter):

        1. Lower security risk overall
        2. Limited access to system internals
        3. Typically only provides console access
        4. Can potentially expose sensitive information in debug output
        5. Easier to secure by disabling or removing headers

        JTAG (Joint Test Action Group):

        1. Higher security risk
        2. Provides deep access to system internals
        3. Allows for full control of the processor and memory
        4. Can be used to extract firmware, modify code, and bypass security measures
        5. More challenging to fully secure, often requires physical fuses or permanent disabling
        >>> # DeepSeek (inference profile)
        >>> print(
        ...     simple_chat(
        ...         router,
        ...         "Summarize UART vs JTAG risks in 3 bullets",
        ...         model="us.deepseek.r1-v1:0",
        ...     )
        ... )
        - **Access Level**: UART exposes a serial console for command-line interaction, risking unauthorized system
        access, while JTAG provides deeper hardware control, enabling memory/firmware manipulation and security bypass.
        - **Exploitation Barrier**: UART requires basic tools (e.g., USB-to-TTL) and minimal expertise, making it easier
        to exploit, whereas JTAG demands specialized tools and advanced knowledge, raising the entry barrier for attackers.
        - **Impact Severity**: UART compromises may lead to configuration changes or log leaks, but JTAG breaches can
        result in full system control, firmware extraction, or intellectual property theft, posing a critical threat.
        >>> # Llama
        >>> print(
        ...     simple_chat(
        ...         router,
        ...         "Summarize UART vs JTAG risks in a One-liner",
        ...         model="meta.llama3-8b-instruct-v1:0",
        ...     )
        ... )
        UART (Universal Asynchronous Receiver-Transmitter) and JTAG (Joint Test Action Group) are both debugging interfaces,
        but UART is a more vulnerable and risky option due to its ability to be easily accessed and manipulated by an attacker,
        whereas JTAG is a more secure option due to its complexity and limited accessibility, making it a better choice for
        debugging and testing purposes.

    Args:
        router (Router): The Router instance to use for selecting the provider.
        prompt (str): The user prompt to send to the LLM.
        task_tag (str): A tag to categorize the task (default is "generic").
        model (Optional[str]): An optional model name to use for the request.
    """
    req = ChatRequest(
        messages=[Message(role="user", content=prompt)], task_tag=task_tag, model=model
    )
    provider, chosen = router.choose(req)
    resp = provider.chat(chosen)
    return resp.content if resp.content else f"(tool_calls={resp.tool_calls})"