Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SakanaAI/AI-Scientist-v2
/ functions
Functions
307 in github.com/SakanaAI/AI-Scientist-v2
⨍
Functions
307
◇
Types & classes
36
↓ 122 callers
Method
append
Append a new node to the journal.
ai_scientist/treesearch/journal.py:374
↓ 32 callers
Method
write
(self, msg)
ai_scientist/treesearch/interpreter.py:74
↓ 20 callers
Function
get_response_from_llm
( prompt, client, model, system_message, print_debug=False, msg_history=None, temp
ai_scientist/llm.py:267
↓ 20 callers
Function
query
General LLM query for various backends with a single system and user message. Supports function calling for some backends. Args:
ai_scientist/treesearch/backend/__init__.py:19
↓ 14 callers
Method
get_best_node
Return the best solution found so far.
ai_scientist/treesearch/journal.py:420
↓ 13 callers
Method
run
Execute the provided Python command in a separate process and return its output. Parameters: code (str): Python code to
ai_scientist/treesearch/interpreter.py:213
↓ 11 callers
Function
extract_json_between_markers
(llm_output: str)
ai_scientist/llm.py:452
↓ 11 callers
Function
wrap_code
Wraps code with three backticks.
ai_scientist/treesearch/utils/response.py:7
↓ 7 callers
Method
cleanup_session
(self)
ai_scientist/treesearch/interpreter.py:196
↓ 7 callers
Function
create_client
(model)
ai_scientist/llm.py:480
↓ 7 callers
Method
plan_and_code_query
Generate a natural language plan + code in the same LLM call and split them apart.
ai_scientist/treesearch/parallel_agent.py:658
↓ 7 callers
Method
to_dict
Convert node to dictionary for serialization
ai_scientist/treesearch/journal.py:214
↓ 6 callers
Method
from_dict
Create a Node from a dictionary, optionally linking to journal for relationships
ai_scientist/treesearch/journal.py:294
↓ 6 callers
Function
get_node_log
(node)
ai_scientist/treesearch/log_summarization.py:156
↓ 6 callers
Method
update
()
ai_scientist/treesearch/utils/viz_templates/template.js:47
↓ 5 callers
Method
_get_best_implementation
Get the best implementation from a completed stage
ai_scientist/treesearch/agent_manager.py:538
↓ 5 callers
Function
compile_latex
(cwd, pdf_file, timeout=30)
ai_scientist/perform_icbinb_writeup.py:45
↓ 5 callers
Method
generate_summary
Generate a summary of the research progress using LLM, including both successes and failures.
ai_scientist/treesearch/journal.py:504
↓ 5 callers
Function
load_paper
(pdf_path, num_pages=None, min_size=100)
ai_scientist/perform_llm_review.py:257
↓ 5 callers
Method
step
(self, exec_callback: ExecCallbackType)
ai_scientist/treesearch/parallel_agent.py:2053
↓ 4 callers
Method
parse_stage_names
Parse stage name into main stage number, main stage name, sub-stage number, and sub-stage name
ai_scientist/treesearch/agent_manager.py:927
↓ 3 callers
Method
_generate_node_summary
Generate a summary of the node's experimental findings
ai_scientist/treesearch/parallel_agent.py:1035
↓ 3 callers
Method
_get_max_iterations
Get max iterations for a stage from config or default
ai_scientist/treesearch/agent_manager.py:171
↓ 3 callers
Function
_parse_keyword_prefix_response
Parse the response into name and description based on keyword prefix
ai_scientist/treesearch/parallel_agent.py:41
↓ 3 callers
Function
calculate_accuracy
(model, data_loader, device, max_batches=None)
ai_scientist/ideas/i_cant_believe_its_not_betterrealworld.py:235
↓ 3 callers
Function
calculate_accuracy
(model, data_loader, device, max_batches=None)
ai_scientist/ideas/i_cant_believe_its_not_better.py:267
↓ 3 callers
Method
color
()
ai_scientist/treesearch/utils/viz_templates/template.js:72
↓ 3 callers
Function
compile_latex
(cwd, pdf_file, timeout=30)
ai_scientist/perform_writeup.py:39
↓ 3 callers
Function
encode_image_to_base64
Convert an image to base64 string.
ai_scientist/vlm.py:35
↓ 3 callers
Function
extract_figure_screenshots
Extract screenshots for figure captions ("Figure X." or "Figure X:") and also gather text blocks (anywhere in the PDF) mentioning that ex
ai_scientist/perform_vlm_review.py:154
↓ 3 callers
Function
extract_json_between_markers
(llm_output: str)
ai_scientist/vlm.py:216
↓ 3 callers
Function
filter_experiment_summaries
(exp_summaries, step_name)
ai_scientist/perform_icbinb_writeup.py:691
↓ 3 callers
Function
get_reflection_page_info
(reflection_pdf, page_limit)
ai_scientist/perform_icbinb_writeup.py:304
↓ 3 callers
Function
get_response_from_vlm
Get response from vision-language model.
ai_scientist/vlm.py:132
↓ 3 callers
Function
load_exp_summaries
Load the experiment summaries from the base folder.
ai_scientist/perform_icbinb_writeup.py:665
↓ 3 callers
Function
load_idea_text
Load the idea text from the base folder.
ai_scientist/perform_icbinb_writeup.py:648
↓ 3 callers
Function
step_callback
(stage, journal)
ai_scientist/treesearch/perform_experiments_bfts_with_agentmanager.py:103
↓ 2 callers
Method
_curate_task_desc
(self, stage: Stage)
ai_scientist/treesearch/agent_manager.py:216
↓ 2 callers
Method
_drain_queues
Quickly drain all in-flight messages to prevent blocking.
ai_scientist/treesearch/interpreter.py:176
↓ 2 callers
Function
_get_next_logindex
Get the next available index for a log directory.
ai_scientist/treesearch/utils/config.py:112
↓ 2 callers
Method
_parse_vlm_feedback
Parse the feedback from the VLM
ai_scientist/treesearch/agent_manager.py:331
↓ 2 callers
Method
acquire_gpu
Assigns a GPU to a process
ai_scientist/treesearch/parallel_agent.py:1099
↓ 2 callers
Method
add_interaction
Record a single interaction with the model.
ai_scientist/utils/token_tracker.py:75
↓ 2 callers
Method
add_tokens
( self, model: str, prompt_tokens: int, completion_tokens: int, reason
ai_scientist/utils/token_tracker.py:62
↓ 2 callers
Function
aggregate_plots
( base_folder: str, model: str = "o1-2024-12-17", n_reflections: int = 5 )
ai_scientist/perform_plotting.py:136
↓ 2 callers
Function
backoff_create
( create_fn: Callable, retry_exceptions: list[Exception], *args, **kwargs )
ai_scientist/treesearch/backend/utils.py:23
↓ 2 callers
Function
clean_lines
Given raw text content, split it into lines and remove lines that are likely headers/footers or otherwise not part of the main content.
ai_scientist/perform_icbinb_writeup.py:111
↓ 2 callers
Function
clean_up_dataset
(path: Path)
ai_scientist/treesearch/utils/__init__.py:40
↓ 2 callers
Function
compile_prompt_to_md
Convert a prompt into markdown format
ai_scientist/treesearch/backend/utils.py:44
↓ 2 callers
Function
extract_abstract
(text)
ai_scientist/perform_vlm_review.py:311
↓ 2 callers
Function
extract_code
Extract python code blocks from the text.
ai_scientist/treesearch/utils/response.py:55
↓ 2 callers
Function
extract_code_snippet
Look for a Python code block in triple backticks in the LLM response. Return only that code. If no code block is found, return the entire tex
ai_scientist/perform_plotting.py:89
↓ 2 callers
Function
extract_text_up_to_code
Extract (presumed) natural language text up to the start of the first code block.
ai_scientist/treesearch/utils/response.py:79
↓ 2 callers
Function
format_code
Format Python code using Black.
ai_scientist/treesearch/utils/response.py:86
↓ 2 callers
Function
gather_citations
Gather citations for a paper, with ability to resume from previous progress. Args: base_folder: Path to project folder num_c
ai_scientist/perform_icbinb_writeup.py:745
↓ 2 callers
Function
generate_vlm_img_review
(img, model, client)
ai_scientist/perform_vlm_review.py:363
↓ 2 callers
Function
get_ai_client
Get the appropriate AI client based on the model string. Args: model (str): string identifier for the model to use (e.g. "gpt-4-turb
ai_scientist/treesearch/backend/__init__.py:4
↓ 2 callers
Function
get_completed_stages
Determine completed stages by checking for the existence of stage directories that contain evidence of completion (tree_data.json, tree_plot.
ai_scientist/treesearch/utils/tree_export.py:43
↓ 2 callers
Function
get_file_len_size
Calculate the size of a file (#lines for plaintext files, otherwise #bytes) Also returns a human-readable string representation of the size.
ai_scientist/treesearch/utils/data_preview.py:19
↓ 2 callers
Method
get_mean_value
Get the mean value across all metrics and datasets
ai_scientist/treesearch/utils/metric.py:302
↓ 2 callers
Method
get_node_by_id
Get a node by its ID.
ai_scientist/treesearch/journal.py:409
↓ 2 callers
Function
get_nodes_infos
(nodes)
ai_scientist/treesearch/log_summarization.py:109
↓ 2 callers
Method
isMouseOver
(p5)
ai_scientist/treesearch/utils/viz_templates/template.js:120
↓ 2 callers
Function
load_cfg
Load config from .yaml file and CLI args, and set up logging directory.
ai_scientist/treesearch/utils/config.py:134
↓ 2 callers
Function
make_llm_call
(client, model, temperature, system_message, prompt)
ai_scientist/llm.py:216
↓ 2 callers
Function
opt_messages_to_list
( system_message: str | None, user_message: str | None )
ai_scientist/treesearch/backend/utils.py:33
↓ 2 callers
Function
overall_summarize
(journals, cfg=None)
ai_scientist/treesearch/log_summarization.py:299
↓ 2 callers
Function
perform_experiments_bfts
(config_path: str)
ai_scientist/treesearch/perform_experiments_bfts_with_agentmanager.py:58
↓ 2 callers
Function
perform_imgs_cap_ref_review
(client, client_model, pdf_path)
ai_scientist/perform_vlm_review.py:372
↓ 2 callers
Function
perform_writeup
( base_folder, no_writing=False, num_cite_rounds=20, small_model="gpt-4o-2024-05-13", big_
ai_scientist/perform_writeup.py:455
↓ 2 callers
Method
release_gpu
Releases GPU assigned to a process
ai_scientist/treesearch/parallel_agent.py:1112
↓ 2 callers
Method
render
(p5)
ai_scientist/treesearch/utils/viz_templates/template.js:79
↓ 2 callers
Function
run_aggregator_script
( aggregator_code, aggregator_script_path, base_folder, script_name )
ai_scientist/perform_plotting.py:99
↓ 2 callers
Function
save_token_tracker
(idea_dir)
launch_scientist_bfts.py:35
↓ 2 callers
Function
search_for_papers
(query, result_limit=10)
ai_scientist/tools/semantic_scholar.py:104
↓ 2 callers
Function
startSketch
(stageId)
ai_scientist/treesearch/utils/viz_templates/template.js:352
↓ 2 callers
Function
updateNodeInfo
(nodeIndex)
ai_scientist/treesearch/utils/viz_templates/template.js:328
↓ 1 callers
Method
__init__
(self, num_gpus: int)
ai_scientist/treesearch/parallel_agent.py:1094
↓ 1 callers
Method
__post_init__
(self)
ai_scientist/treesearch/utils/metric.py:144
↓ 1 callers
Method
__repr__
Return string representation
ai_scientist/treesearch/utils/metric.py:259
↓ 1 callers
Method
__str__
(self)
ai_scientist/treesearch/utils/metric.py:206
↓ 1 callers
Method
_aggregate_seed_eval_results
Generate aggregated plots from multi-seed evaluation results. Args: seed_nodes: List of nodes from seed evaluation pa
ai_scientist/treesearch/parallel_agent.py:2228
↓ 1 callers
Method
_analyze_plots_with_vlm
Analyze experimental plots using VLM
ai_scientist/treesearch/parallel_agent.py:894
↓ 1 callers
Method
_analyze_progress
Analyze progress and convergence in the current stage
ai_scientist/treesearch/agent_manager.py:1127
↓ 1 callers
Method
_check_stage_completion
Check if current stage is complete based on criteria
ai_scientist/treesearch/agent_manager.py:410
↓ 1 callers
Method
_check_substage_completion
Check if the current sub-stage is complete
ai_scientist/treesearch/agent_manager.py:343
↓ 1 callers
Method
_create_agent_for_stage
Create a ParallelAgent configured for the given stage
ai_scientist/treesearch/agent_manager.py:274
↓ 1 callers
Method
_create_initial_stage
Create the initial stage configuration
ai_scientist/treesearch/agent_manager.py:200
↓ 1 callers
Method
_create_next_main_stage
( self, current_substage: Stage, journal: Journal )
ai_scientist/treesearch/agent_manager.py:664
↓ 1 callers
Method
_create_next_substage
Create the next sub-stage. Ask LLM to come up with the next sub-stage name and goals based on what has been done so far.
ai_scientist/treesearch/agent_manager.py:638
↓ 1 callers
Method
_debug
(self, parent_node: Node)
ai_scientist/treesearch/parallel_agent.py:494
↓ 1 callers
Method
_define_global_metrics
Define eval metric to be used across all experiments
ai_scientist/treesearch/parallel_agent.py:1194
↓ 1 callers
Method
_determine_datasets_successfully_tested
Determine which datasets are successfully tested based on VLM feedback
ai_scientist/treesearch/parallel_agent.py:835
↓ 1 callers
Method
_draft
(self)
ai_scientist/treesearch/parallel_agent.py:453
↓ 1 callers
Method
_gather_stage_metrics
Gather detailed metrics and analysis from the stage's nodes
ai_scientist/treesearch/agent_manager.py:1041
↓ 1 callers
Method
_generate_ablation_idea
Generate the next ablation idea based on what's been done
ai_scientist/treesearch/parallel_agent.py:1860
↓ 1 callers
Method
_generate_ablation_node
(self, parent_node: Node, ablation_idea: AblationIdea)
ai_scientist/treesearch/parallel_agent.py:605
↓ 1 callers
Method
_generate_hyperparam_tuning_idea
Generate the next hyperparam tuning idea based on what's been done. This is minaly for Stage 2 (baseline tuning).
ai_scientist/treesearch/parallel_agent.py:1798
↓ 1 callers
Method
_generate_hyperparam_tuning_node
( self, parent_node: Node, hyperparam_idea: HyperparamTuningIdea )
ai_scientist/treesearch/parallel_agent.py:557
↓ 1 callers
Method
_generate_plotting_code
Generate code for plotting experiment results
ai_scientist/treesearch/parallel_agent.py:720
next →
1–100 of 307, ranked by callers