Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SqueezeAILab/LLMCompiler
/ functions
Functions
245 in github.com/SqueezeAILab/LLMCompiler
⨍
Functions
245
◇
Types & classes
38
↓ 14 callers
Method
join
( self, input_query: str, agent_scratchpad: str, is_final: bool )
src/llm_compiler/llm_compiler.py:201
↓ 12 callers
Function
log
Print the given string only if logging is enabled.
src/utils/logger_utils.py:59
↓ 7 callers
Method
parse
Parse text into agent action/finish.
src/agents/agent.py:36
↓ 6 callers
Method
tool_run_logging_kwargs
(self)
src/agents/agent.py:284
↓ 5 callers
Method
apredict
Format prompt with kwargs and pass to LLM. Args: callbacks: Callbacks to pass to LLMChain **kwargs: Keys to pass to p
src/chains/llm_chain.py:307
↓ 5 callers
Function
get_model
( model_type, model_name, vllm_port, stream, temperature=0, )
src/utils/model_utils.py:6
↓ 5 callers
Method
predict
Format prompt with kwargs and pass to LLM. Args: callbacks: Callbacks to pass to LLMChain **kwargs: Keys to pass to p
src/chains/llm_chain.py:290
↓ 5 callers
Method
run
Convenience method for executing chain. The main difference between this method and `Chain.__call__` is that this method expects inpu
src/chains/chain.py:444
↓ 5 callers
Method
search
Try to search for wiki page. If page exists, return the page summary, and a PageWithLookups object. If page does not exist, return si
src/docstore/wikipedia.py:144
↓ 4 callers
Method
_areturn
( self, output: AgentFinish, intermediate_steps: list, run_manager: Optional[A
src/executors/agent_executor.py:224
↓ 4 callers
Method
acall
Asynchronously execute the chain. Args: inputs: Dictionary of inputs, or single input if chain expects only one p
src/chains/chain.py:308
↓ 4 callers
Function
clean_str
(p)
src/docstore/wikipedia.py:14
↓ 4 callers
Method
create_outputs
Create outputs from response.
src/chains/llm_chain.py:268
↓ 4 callers
Function
normalize_answer
(s)
src/utils/evaluation_utils.py:8
↓ 3 callers
Function
_make_with_name
(tool_name: str)
src/tools/base.py:413
↓ 3 callers
Method
_return
( self, output: AgentFinish, intermediate_steps: list, run_manager: Optional[C
src/executors/agent_executor.py:211
↓ 3 callers
Method
arun
Convenience method for executing chain. The main difference between this method and `Chain.__call__` is that this method expects inpu
src/chains/chain.py:514
↓ 3 callers
Method
from_llm
( cls, llm: BaseLanguageModel, prompt: BasePromptTemplate = PROMPT, **kwargs:
src/chains/llm_math_chain.py:289
↓ 3 callers
Method
return_stopped_response
Return response when agent has been stopped due to max iterations.
src/agents/agent.py:242
↓ 2 callers
Method
_acall
Asynchronously execute the chain. This is a private method that is not user-facing. It is only called within `Chain.acall`, which
src/chains/chain.py:216
↓ 2 callers
Method
_all_tasks_done
(self)
src/llm_compiler/task_fetching_unit.py:97
↓ 2 callers
Method
_call
Execute the chain. This is a private method that is not user-facing. It is only called within `Chain.__call__`, which is the user
src/chains/chain.py:193
↓ 2 callers
Method
_evaluate_expression
(self, expression: str)
src/chains/llm_math_chain.py:186
↓ 2 callers
Method
_get_all_executable_tasks
(self)
src/llm_compiler/task_fetching_unit.py:100
↓ 2 callers
Method
_get_alternative
(self, result: str)
src/docstore/wikipedia.py:67
↓ 2 callers
Method
_get_page_obs
(page)
src/docstore/wikipedia.py:55
↓ 2 callers
Method
_get_tool_return
Check if the tool is a returning tool.
src/executors/agent_executor.py:548
↓ 2 callers
Method
_match_buffer_and_generate_task
Runs every time "\n" is encountered in the input stream or at the end of the stream. Matches the buffer against the regex patterns and generat
src/llm_compiler/planner.py:96
↓ 2 callers
Method
_parse_generation
( self, generation: List[Dict[str, str]] )
src/chains/llm_chain.py:363
↓ 2 callers
Method
_prepare_intermediate_steps
( self, intermediate_steps: List[Tuple[AgentAction, str]] )
src/executors/agent_executor.py:563
↓ 2 callers
Method
_run_task
(self, task: Task)
src/llm_compiler/task_fetching_unit.py:117
↓ 2 callers
Method
_should_continue
(self, iterations: int, time_elapsed: float)
src/executors/agent_executor.py:200
↓ 2 callers
Method
agenerate
Generate LLM result from inputs.
src/chains/llm_chain.py:138
↓ 2 callers
Method
apost_process
( self, response_text: str, entity: str, skip_retry_when_postprocess: bool = False )
src/docstore/wikipedia.py:111
↓ 2 callers
Method
asearch
Try to search for wiki page. If page exists, return the page summary, and a PageWithLookups object. If page does not exist, return si
src/docstore/wikipedia.py:182
↓ 2 callers
Function
compare_answer
Compare the answer (from Agent) and label (GT). Label can be either a string or a number. If label is a number, we allow 10% margin. Other
src/utils/evaluation_utils.py:63
↓ 2 callers
Function
enable_logging
Toggle logging on or off based on the given argument.
src/utils/logger_utils.py:53
↓ 2 callers
Method
generate
Generate LLM result from inputs.
src/chains/llm_chain.py:103
↓ 2 callers
Function
generate_llm_compiler_prompt
( tools: Sequence[Union[Tool, StructuredTool]], example_prompt=str, is_replan: bool = False, )
src/llm_compiler/planner.py:36
↓ 2 callers
Method
get_full_inputs
Create the full inputs for the LLMChain from intermediate steps.
src/agents/agent.py:161
↓ 2 callers
Method
get_stats
(self)
src/docstore/wikipedia.py:49
↓ 2 callers
Method
get_though_action_observation
( self, include_action=True, include_thought=True, include_action_idx=False )
src/llm_compiler/task_fetching_unit.py:59
↓ 2 callers
Function
instantiate_task
( tools: Sequence[Union[Tool, StructuredTool]], idx: int, tool_name: str, args: str, thoug
src/llm_compiler/output_parser.py:111
↓ 2 callers
Method
post_process
( self, response_text: str, entity: str, skip_retry_when_postprocess: bool = False )
src/docstore/wikipedia.py:78
↓ 2 callers
Method
prep_inputs
Validate and prepare chain inputs, including adding inputs from memory. Args: inputs: Dictionary of raw inputs, or single input i
src/chains/chain.py:403
↓ 2 callers
Method
prep_outputs
Validate and prepare chain outputs, and save info about this run to memory. Args: inputs: Dictionary of chain inputs, including a
src/chains/chain.py:377
↓ 2 callers
Method
reset
(self)
src/docstore/wikipedia.py:46
↓ 2 callers
Method
run_llm
Run the LLM.
src/llm_compiler/planner.py:216
↓ 2 callers
Method
set_tasks
(self, tasks: dict[str, Any])
src/llm_compiler/task_fetching_unit.py:92
↓ 1 callers
Method
__init__
(self)
src/callbacks/callbacks.py:11
↓ 1 callers
Method
_aprocess_llm_result
( self, llm_output: str, run_manager: AsyncCallbackManagerForChainRun, )
src/chains/llm_math_chain.py:234
↓ 1 callers
Method
_atake_next_step
Take a single step in the thought-action-observation loop. Override this to take control of how the agent makes and acts on choices.
src/executors/agent_executor.py:335
↓ 1 callers
Method
_construct_scratchpad
Construct the scratchpad that lets the agent continue its thought process.
src/agents/agent.py:89
↓ 1 callers
Function
_create_subset_model
Create a pydantic model with only a subset of model's fields.
src/tools/base.py:30
↓ 1 callers
Function
_default_stringify_rule_for_arguments
(args)
src/llm_compiler/task_fetching_unit.py:12
↓ 1 callers
Function
_find_tool
Find a tool by name. Args: tool_name: Name of the tool to find. Returns: Tool or StructuredTool.
src/llm_compiler/output_parser.py:80
↓ 1 callers
Method
_format_contexts
contexts is a list of context each context is formatted as the description of _generate_context_for_replanner
src/llm_compiler/llm_compiler.py:191
↓ 1 callers
Method
_generate_context_for_replanner
Formatted like this: ``` 1. action 1 Observation: xxx 2. action 2 Observation: yyy ... Thought
src/llm_compiler/llm_compiler.py:165
↓ 1 callers
Method
_get_accuracy
(self, key: str)
src/utils/logger_utils.py:26
↓ 1 callers
Method
_get_default_output_parser
Get default output parser for this class.
src/agents/agent.py:213
↓ 1 callers
Method
_get_default_output_parser
( cls, llm: Optional[BaseLanguageModel] = None, **kwargs: Any )
src/agents/structured_chat_agent.py:64
↓ 1 callers
Function
_get_dependencies_from_graph
Get dependencies from a graph.
src/llm_compiler/output_parser.py:97
↓ 1 callers
Function
_get_filtered_args
Get the arguments from a function's signature.
src/tools/base.py:41
↓ 1 callers
Method
_get_mean_latency
(self, key: str)
src/utils/logger_utils.py:22
↓ 1 callers
Function
_get_verbosity
()
src/chains/chain.py:34
↓ 1 callers
Method
_parse_joinner_output
We expect the joinner output format to be: ``` Thought: xxx Action: Finish/Replan(yyy) ``` Returns:
src/llm_compiler/llm_compiler.py:144
↓ 1 callers
Function
_parse_llm_compiler_action_args
Parse arguments from a string.
src/llm_compiler/output_parser.py:64
↓ 1 callers
Method
_preprocess_args
Replace dependency placeholders, i.e. ${1}, in task.args with the actual observation.
src/llm_compiler/task_fetching_unit.py:109
↓ 1 callers
Method
_process_llm_result
( self, llm_output: str, run_manager: CallbackManagerForChainRun )
src/chains/llm_math_chain.py:214
↓ 1 callers
Function
_replace_arg_mask_with_real_value
( args, dependencies: List[int], tasks: Dict[str, Task] )
src/llm_compiler/task_fetching_unit.py:19
↓ 1 callers
Method
_take_next_step
Take a single step in the thought-action-observation loop. Override this to take control of how the agent makes and acts on choices.
src/executors/agent_executor.py:239
↓ 1 callers
Method
_validate_inputs
Check that all inputs are present.
src/chains/chain.py:181
↓ 1 callers
Method
_validate_outputs
(self, outputs: Dict[str, Any])
src/chains/chain.py:187
↓ 1 callers
Method
_validate_tools
Validate that appropriate tools are passed in.
src/agents/agent.py:207
↓ 1 callers
Method
_validate_tools
(cls, tools: Sequence[BaseTool])
src/agents/structured_chat_agent.py:60
↓ 1 callers
Method
aapply
Utilize the LLM generate method for speed gains.
src/chains/llm_chain.py:244
↓ 1 callers
Method
ainvoke
( self, input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kw
src/tools/base.py:107
↓ 1 callers
Method
aplan
Given input, asynchronously decide what to do.
src/llm_compiler/planner.py:265
↓ 1 callers
Method
aplan
Given input, decided what to do. Args: intermediate_steps: Steps the LLM has taken to date, along with observatio
src/agents/agent.py:127
↓ 1 callers
Method
apply
Utilize the LLM generate method for speed gains.
src/chains/llm_chain.py:224
↓ 1 callers
Method
aprep_prompts
Prepare prompts from inputs.
src/chains/llm_chain.py:198
↓ 1 callers
Method
arun
(self, prompt: str, callbacks=None)
src/llm_compiler/llm_compiler.py:28
↓ 1 callers
Function
arun_and_time
helper function to run and time a function. Since function can error, we catch the error and return "ERROR" as the result
src/utils/evaluation_utils.py:40
↓ 1 callers
Method
aschedule
Asynchronously listen to task_queue and schedule tasks as they arrive.
src/llm_compiler/task_fetching_unit.py:137
↓ 1 callers
Method
create_prompt
( cls, tools: Sequence[BaseTool], prefix: str = PREFIX, suffix: str = SUFFIX,
src/agents/structured_chat_agent.py:74
↓ 1 callers
Function
create_schema_from_function
Create a pydantic schema from a function's signature. Args: model_name: Name to assign to the generated pydandic schema func: Func
src/tools/base.py:58
↓ 1 callers
Function
default_dependency_rule
(idx, args: str)
src/llm_compiler/output_parser.py:19
↓ 1 callers
Method
dict
Dictionary representation of chain. Expects `Chain._chain_type` property to be implemented and for memory to be null. Ar
src/chains/chain.py:585
↓ 1 callers
Method
dict
Return dictionary representation of agent.
src/agents/agent.py:60
↓ 1 callers
Method
finalize
(self)
src/llm_compiler/planner.py:141
↓ 1 callers
Function
flush_results
(save_path, results)
src/utils/logger_utils.py:69
↓ 1 callers
Method
from_agent_and_tools
Create from agent and tools.
src/executors/agent_executor.py:104
↓ 1 callers
Method
from_function
Initialize tool from a function.
src/tools/base.py:199
↓ 1 callers
Method
from_llm_and_tools
Construct an agent from an LLM and tools.
src/agents/agent.py:217
↓ 1 callers
Method
get_all_stats
(self)
src/llm_compiler/llm_compiler.py:117
↓ 1 callers
Method
get_allowed_tools
(self)
src/agents/agent.py:71
↓ 1 callers
Function
get_configs
(args)
run_llm_compiler.py:108
↓ 1 callers
Function
get_dataset
(args)
run_llm_compiler.py:76
↓ 1 callers
Method
get_stats
(self)
src/callbacks/callbacks.py:35
↓ 1 callers
Function
get_tools
(model_name, args)
run_llm_compiler.py:87
next →
1–100 of 245, ranked by callers