Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/algorithmicsuperintelligence/optillm
/ functions
Functions
1,129 in github.com/algorithmicsuperintelligence/optillm
⨍
Functions
1,129
◇
Types & classes
178
↳
Endpoints
25
↓ 3 callers
Method
process_batch
Process a batch of prompts with MLX-based batch inference This method provides true batch processing for MLX models, process
optillm/inference.py:458
↓ 3 callers
Function
re2_approach
Implement the RE2 (Re-Reading) approach for improved reasoning in LLMs. Args: system_prompt (str): The system prompt to be used. ini
optillm/reread.py:7
↓ 3 callers
Function
round_trip_optimization
(system_prompt: str, initial_query: str, client, model: str, request_config: dict = None, request_id: str = No
optillm/rto.py:18
↓ 3 callers
Function
run
(*args)
tests/test_json_plugin.py:35
↓ 3 callers
Method
set_active_adapter
Set a specific adapter as active with error handling
optillm/inference.py:1188
↓ 3 callers
Method
solve
Synchronous wrapper for solve_async method.
optillm/rstar.py:346
↓ 3 callers
Method
solve
(self, initial_query: str)
optillm/leap.py:230
↓ 3 callers
Method
standard_llm_inference
(self, query: str)
optillm/z3_solver.py:252
↓ 3 callers
Method
update_token_history
Update the token history with new tokens. Args: new_tokens: New token IDs to add
optillm/autothink/steering.py:525
↓ 3 callers
Function
validate_deepconf_config
Validate and normalize DeepConf configuration. Args: config: Input configuration dictionary Returns: Valida
optillm/deepconf/deepconf.py:122
↓ 2 callers
Method
_apply_steering_vector
Apply a steering vector to hidden states. Args: hidden_states: The hidden states tensor steering_vec
optillm/autothink/steering.py:393
↓ 2 callers
Method
_cleanup_caches
Clean up caches if they exceed max size.
optillm/inference.py:916
↓ 2 callers
Method
_cleanup_steering
Clean up steering hooks.
optillm/autothink/processor.py:145
↓ 2 callers
Method
_create_stopping_criteria
Create stopping criteria for generation
optillm/inference.py:1488
↓ 2 callers
Method
_execute_handler
Execute a handler function with proper signature detection
optillm/plugins/proxy/approach_handler.py:152
↓ 2 callers
Method
_extract_answer
Extract the final answer from the response.
optillm/plugins/deepthink/uncertainty_cot.py:179
↓ 2 callers
Method
_extract_thinking
Extract content from <think> tags.
optillm/plugins/deepthink/uncertainty_cot.py:172
↓ 2 callers
Method
_filter_kwargs
Filter out OptiLLM-specific parameters that shouldn't be sent to providers
optillm/plugins/proxy/client.py:170
↓ 2 callers
Method
_get_adapter_name
Create a valid adapter name from adapter_id.
optillm/inference.py:1121
↓ 2 callers
Method
_get_bytes_for_token
Get UTF-8 bytes for a token
optillm/inference.py:131
↓ 2 callers
Method
_get_log_file_path
Get the log file path for a given timestamp (defaults to now)
optillm/conversation_logger.py:51
↓ 2 callers
Method
_get_verification_summary
Generate a summary of all verification results
optillm/mars/workspace.py:155
↓ 2 callers
Method
_linear_attention
Implements linear attention for more memory efficiency
optillm/inference.py:663
↓ 2 callers
Method
_robust_mlx_generate
Robust MLX generation using sampler approach
optillm/inference.py:401
↓ 2 callers
Method
add_reasoning_example
Add a reasoning example to the strategy.
optillm/plugins/spl/strategy.py:116
↓ 2 callers
Method
add_token_confidence
Add a new token's confidence and update group statistics. Args: logits: Raw logits tensor for current token posi
optillm/deepconf/confidence.py:83
↓ 2 callers
Method
add_warmup_trace
Add confidence statistics from a warmup trace. Args: confidence_stats: Dictionary with confidence metrics
optillm/deepconf/confidence.py:194
↓ 2 callers
Function
analyze_logits_probs
Analyze token probability distributions and entropy patterns. Args: logprobs_data: List of dictionaries containing token and log
scripts/eval_aime_benchmark.py:185
↓ 2 callers
Method
apply_action
(self, state: DialogueState, action: str)
optillm/mcts.py:146
↓ 2 callers
Method
apply_principles
(self, query: str)
optillm/leap.py:202
↓ 2 callers
Function
autothink_decode
Main plugin execution function with AutoThink's controlled thinking process. Args: model: Language model tokenizer: Mode
optillm/autothink/autothink.py:59
↓ 2 callers
Method
backpropagate
(self, node: Node, value: float)
optillm/rstar.py:167
↓ 2 callers
Function
calculate_accuracy
(predictions, labels)
scripts/train_optillm_classifier.py:107
↓ 2 callers
Method
calculate_threshold
Calculate the confidence threshold based on warmup traces. Args: metric: Which confidence metric to use for thre
optillm/deepconf/confidence.py:203
↓ 2 callers
Method
calculate_token_confidence
Calculate token confidence: C = -(1/k) ∑log P(j) for top-k tokens Args: logits: Raw logits tensor for current to
optillm/deepconf/confidence.py:59
↓ 2 callers
Function
cepo
Applies CePO reasoning flow for the given task. First, it generates multiple completions, and then rates them to select the best one. Each co
optillm/cepo/cepo.py:960
↓ 2 callers
Function
clean_text
Clean text by removing extra whitespace and normalizing newlines
scripts/gen_optillmbench.py:134
↓ 2 callers
Function
cleanup_placeholder_tags
Remove any remaining placeholder tags from the final report. This is a final cleanup step to ensure no incomplete research tags remain
optillm/plugins/deep_research/research_engine.py:65
↓ 2 callers
Method
connect_stdio_native
Connect using stdio transport with local executable
optillm/plugins/mcp_plugin.py:392
↓ 2 callers
Method
connect_websocket
Connect to server using WebSocket transport and discover capabilities
optillm/plugins/mcp_plugin.py:373
↓ 2 callers
Method
create_default_config
Create a default configuration file if none exists
optillm/plugins/mcp_plugin.py:209
↓ 2 callers
Method
create_prompt
(self, state: str, action: str)
optillm/rstar.py:250
↓ 2 callers
Method
evaluate
(self, node: Node)
optillm/rstar.py:303
↓ 2 callers
Function
execute_code
Execute Python code in a Jupyter notebook environment.
optillm/plugins/executecode_plugin.py:25
↓ 2 callers
Function
execute_tool_sse
Execute tool using SSE transport
optillm/plugins/mcp_plugin.py:742
↓ 2 callers
Function
execute_tool_websocket
Execute tool using WebSocket transport
optillm/plugins/mcp_plugin.py:778
↓ 2 callers
Method
expand
(self, node: Node, action: str)
optillm/rstar.py:144
↓ 2 callers
Method
expand_async
(self, node: Node, action: str)
optillm/rstar.py:48
↓ 2 callers
Method
extract_and_validate_expressions
(self, analysis: str)
optillm/z3_solver.py:273
↓ 2 callers
Method
extract_answer
(self, final_state: str)
optillm/rstar.py:316
↓ 2 callers
Function
extract_code_blocks
Extract Python code blocks from text.
optillm/plugins/coc_plugin.py:97
↓ 2 callers
Function
extract_code_from_prompt
(text)
optillm/rto.py:8
↓ 2 callers
Function
extract_contents
(response_obj)
optillm/server.py:580
↓ 2 callers
Function
extract_gsm8k_answer
Extract numerical answer after ### from GSM8K responses.
scripts/eval_optillmbench.py:88
↓ 2 callers
Function
extract_optillm_approach
(content)
optillm/server.py:674
↓ 2 callers
Function
extract_question_only
We noticed that sometimes if the task includes specific formatting instructions, they may interfere with the reasoning flow. This is a tempor
optillm/cepo/cepo.py:142
↓ 2 callers
Method
extract_trajectories
(self, root: Node)
optillm/rstar.py:191
↓ 2 callers
Function
find_executable
Find the full path to an executable command. Args: cmd: The command to find Returns: Full path to the execu
optillm/plugins/mcp_plugin.py:79
↓ 2 callers
Method
find_similar_strategy
Find a strategy of the same problem type that is similar to the query. Args: problem_type: The problem type to m
optillm/plugins/spl/strategy.py:314
↓ 2 callers
Method
generate_actions
(self, state: DialogueState)
optillm/mcts.py:112
↓ 2 callers
Method
generate_response
(self, prompt: str)
optillm/rstar.py:103
↓ 2 callers
Method
generate_single_trace
Generate a single reasoning trace with optional early termination. Args: messages: Input messages us
optillm/deepconf/processor.py:91
↓ 2 callers
Function
generate_solutions
(client, system_prompt: str, query: str, model: str, num_solutions: int, is_sneaky: bool = False, temperature:
optillm/pvg.py:11
↓ 2 callers
Method
get_capabilities_description
Get a description of all capabilities
optillm/plugins/mcp_plugin.py:588
↓ 2 callers
Method
get_captured_logs
Get the captured log output
tests/test_mars_imo25.py:145
↓ 2 callers
Method
get_current_group_confidence
Get the most recent group confidence. Returns: Most recent group confidence or None if not available
optillm/deepconf/confidence.py:114
↓ 2 callers
Method
get_instance
Alternative way to get the singleton instance.
optillm/inference.py:953
↓ 2 callers
Method
get_or_load_model
Get or load model and tokenizer with minimal locking.
optillm/inference.py:849
↓ 2 callers
Function
get_problem_by_id
Get problem data by ID
scripts/imo25_reference.py:294
↓ 2 callers
Function
get_simple_test_messages
Get simple test messages for basic validation
tests/test_utils.py:74
↓ 2 callers
Function
get_thinking_test_messages
Get test messages that should generate thinking tokens
tests/test_utils.py:88
↓ 2 callers
Method
get_tools_for_model
Get tools in a format suitable for the model's tool-calling API
optillm/plugins/mcp_plugin.py:566
↓ 2 callers
Method
get_trace_statistics
Get comprehensive confidence statistics for the current trace. Returns: Dictionary with various confidence metri
optillm/deepconf/confidence.py:163
↓ 2 callers
Method
handle
Try to handle the given name as an approach or plugin. Returns None if not found, otherwise returns (response, tokens)
optillm/plugins/proxy/approach_handler.py:21
↓ 2 callers
Method
has_consensus
Check if we have enough verified solutions to reach consensus
optillm/mars/workspace.py:122
↓ 2 callers
Function
init_cepo_config
(cmd_line_args: dict)
optillm/cepo/cepo.py:123
↓ 2 callers
Method
is_active
Check if browser session is active
optillm/plugins/web_search_plugin.py:106
↓ 2 callers
Method
is_terminal
(self, state: DialogueState)
optillm/mcts.py:184
↓ 2 callers
Function
leap
(system_prompt: str, initial_query: str, client, model: str, request_config: dict = None, request_id: str = No
optillm/leap.py:243
↓ 2 callers
Method
list
Return list of supported models
optillm/inference.py:2108
↓ 2 callers
Method
load_dataset
Load and parse SimpleQA dataset
scripts/eval_simpleqa_benchmark.py:172
↓ 2 callers
Function
load_plugins
()
optillm/server.py:287
↓ 2 callers
Function
loop_until_match
Repeatedly calls a function until its output matches one of the given patterns or max attempts is reached. Args: function (Callable)
optillm/plugins/longcepo/utils.py:144
↓ 2 callers
Function
main
Main evaluation function that handles gaps in processed indexes.
scripts/eval_aime_benchmark.py:820
↓ 2 callers
Function
main
()
optillm/server.py:1094
↓ 2 callers
Function
mapreduce
Executes a MapReduce-style inference pipeline to answer a query from long context. The function splits the input context into chunks, summar
optillm/plugins/longcepo/mapreduce.py:38
↓ 2 callers
Method
measure_batch_processing
Measure time for batch processing
tests/test_batching.py:287
↓ 2 callers
Method
measure_sequential_processing
Measure time for sequential processing
tests/test_batching.py:273
↓ 2 callers
Function
mixture_of_agents
(system_prompt: str, initial_query: str, client, model: str, request_config: dict = None, request_id: str = No
optillm/moa.py:7
↓ 2 callers
Function
normalize_answer
Normalize answer for comparison
scripts/eval_imobench_answer.py:70
↓ 2 callers
Function
normalize_interval_bound
Helper function to normalize interval bounds.
scripts/eval_math500_benchmark.py:333
↓ 2 callers
Function
normalize_matrix_entry
Helper function to normalize a single matrix entry.
scripts/eval_math500_benchmark.py:156
↓ 2 callers
Function
parse_combined_approach
(model: str, known_approaches: list, plugin_approaches: dict)
optillm/server.py:362
↓ 2 callers
Method
parse_json_schema_to_pydantic
Convert JSON schema string to Pydantic model.
optillm/plugins/json_plugin.py:54
↓ 2 callers
Method
perform_web_search
Perform web search for multiple queries using the web_search plugin
optillm/plugins/deep_research/research_engine.py:449
↓ 2 callers
Function
plansearch
(system_prompt: str, initial_query: str, client, model: str, n: int = 1, request_config: dict = None, request_
optillm/plansearch.py:212
↓ 2 callers
Method
predict
Predict the complexity label for a given text. Args: text: The query text to classify Retur
optillm/autothink/classifier.py:57
↓ 2 callers
Method
process
Process messages with AutoThink's controlled thinking. Args: messages: List of message dictionaries
optillm/autothink/autothink.py:40
↓ 2 callers
Function
process_single_response
(text)
optillm/server.py:641
↓ 2 callers
Function
remove_chunks
Filter out chunks that contain at least one of irrelevance tags.
optillm/plugins/longcepo/mapreduce.py:22
← previous
next →
101–200 of 1,129, ranked by callers