pe.llm.llm module

class pe.llm.llm.LLM[source]

Bases: ABC

The abstract class for large language models (LLMs).

property generation_arg_map

Get the mapping from the generation arguments to arguments for this specific LLM.

Returns:

The mapping from the generation arguments to the large language model arguments

Return type:

dict

get_generation_args(*args)[source]

Get the generation arguments from a list of dictionaries.

Parameters:

*args (dict) – A list of generation arguments. The later ones will overwrite the earlier ones.

Returns:

The generation arguments

Return type:

dict

abstract get_responses(requests, **generation_args)[source]

Get the responses from the LLM.

Parameters:
  • requests (list[pe.llm.request.Request]) – The requests

  • **generation_args (str) – The generation arguments

Returns:

The responses

Return type:

list[str]