Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/FastMAS/KVCOMM
/ functions
Functions
446 in github.com/FastMAS/KVCOMM
⨍
Functions
446
◇
Types & classes
71
↓ 95 callers
Method
get
Retrieve a concrete `LLM` instance by name and provider hints. Args: model_name: Provider/model identifier; defaults to a general
KVCOMM/llm/llm_registry.py:21
↓ 67 callers
Method
setdefault
(self, key: str, default: Any = None)
KVCOMM/llm/kvcomm_engine.py:599
↓ 66 callers
Method
get
(cls, name: str, *args, **kwargs)
KVCOMM/agents/agent_registry.py:19
↓ 60 callers
Method
items
(self)
KVCOMM/llm/kvcomm_engine.py:585
↓ 53 callers
Method
split
(self)
datasets/mmlu_dataset.py:48
↓ 32 callers
Method
join
(self, timeout=None)
KVCOMM/tools/coding/executor_utils.py:27
↓ 29 callers
Method
keys
(cls)
KVCOMM/llm/llm_registry.py:17
↓ 21 callers
Method
values
(self)
KVCOMM/llm/kvcomm_engine.py:589
↓ 14 callers
Method
get
(self)
experiments/accuracy.py:13
↓ 13 callers
Function
_escape_loguru_markup
Escape Loguru markup tokens in free-form text.
KVCOMM/llm/gpt_chat.py:44
↓ 13 callers
Method
pop
(self, key: str, default: Any = _MISSING)
KVCOMM/llm/kvcomm_engine.py:615
↓ 11 callers
Function
_set_seen_tokens
(cache: DynamicCache, length: int)
KVCOMM/llm/kvcomm_engine.py:190
↓ 11 callers
Method
execute
Synchronous execution wrapper that normalizes outputs to a list.
KVCOMM/graph/node.py:154
↓ 10 callers
Method
_ensure_agent_memory
Return the shared memory slot for a given agent id.
KVCOMM/llm/gpt_chat.py:541
↓ 10 callers
Function
_get_layer_count
Return number of transformer layers tracked in the cache.
KVCOMM/llm/kvcomm_engine.py:32
↓ 10 callers
Function
concat_
In-place concatenation of the token inputs from another TokenInput along the time dimension.
KVCOMM/llm/token_ops.py:76
↓ 10 callers
Method
run
Execute nodes topologically for `num_rounds` and return final answers.
KVCOMM/graph/graph.py:213
↓ 9 callers
Function
_get_layer_kv
Return key/value tensors (or None) for a given layer index.
KVCOMM/llm/kvcomm_engine.py:39
↓ 9 callers
Function
_is_layered_cache
Return True if the cache uses the newer `layers` structure.
KVCOMM/llm/kvcomm_engine.py:27
↓ 8 callers
Method
from_env
Create a config from environment variables with safe defaults.
KVCOMM/llm/config.py:25
↓ 8 callers
Method
get
(self, key: str, default: Any = None)
KVCOMM/llm/kvcomm_engine.py:593
↓ 7 callers
Method
commit
(self)
KVCOMM/llm/kvcomm_engine.py:636
↓ 7 callers
Function
execute_code_get_return
在子进程执行 code,超过 timeout 秒直接终止,并返回 answer 变量(或错误信息)。
KVCOMM/tools/coding/python_executor.py:43
↓ 7 callers
Method
gen
Synchronously generate a completion. Args: messages: Conversation history to condition the model. max_tokens: Maximum
KVCOMM/llm/llm.py:43
↓ 7 callers
Method
resolve_request_state
Public alias to access or create the request-scoped state.
KVCOMM/llm/kvcomm_engine.py:761
↓ 7 callers
Method
set_id
Bind the chat instance to a graph node id and role.
KVCOMM/llm/gpt_chat.py:886
↓ 6 callers
Function
_clone_tensor_or_empty
(tensor: Optional[torch.Tensor])
KVCOMM/llm/kvcomm_engine.py:173
↓ 6 callers
Function
_layer_is_empty
(tensor: Optional[torch.Tensor])
KVCOMM/llm/kvcomm_engine.py:123
↓ 6 callers
Function
_stack_cache_tensors
Return stacked key/value tensors when all layers are dense tensors.
KVCOMM/llm/kvcomm_engine.py:77
↓ 6 callers
Method
_stack_cache_tensors
(cache: DynamicCache)
KVCOMM/llm/kvcomm_engine.py:698
↓ 6 callers
Method
agen
Asynchronously generate a completion. Args: messages: Conversation history to condition the model. max_tokens: Maximu
KVCOMM/llm/llm.py:24
↓ 6 callers
Method
async_execute
Execute a node asynchronously with optional KV cache handling modes.
KVCOMM/graph/node.py:167
↓ 6 callers
Method
finalize_request
(cls, request_uid: str)
KVCOMM/llm/gpt_chat.py:534
↓ 6 callers
Method
generate_for_agent
Generate a response using the requested strategy with sensible fallbacks.
KVCOMM/llm/gpt_chat.py:823
↓ 6 callers
Method
get_decision_few_shot
TODO
KVCOMM/prompt/prompt_set.py:75
↓ 6 callers
Method
has_prefix_initialized
Check if prefix KV has been initialized for an agent.
KVCOMM/llm/gpt_chat.py:553
↓ 6 callers
Method
prepare_prefix_kv_segments
Materialize and store prefix KV segments and placeholder indices. The rendered prompt is tokenized and executed once to obtain the KV
KVCOMM/llm/gpt_chat.py:895
↓ 6 callers
Method
update_input_anchor
Ensure the user input placeholder cache is ready and choose a strategy.
KVCOMM/llm/gpt_chat.py:677
↓ 5 callers
Function
_copy_cache
(cache: DynamicCache)
KVCOMM/llm/kvcomm_engine.py:197
↓ 5 callers
Method
_log_warning
(self, message: str)
KVCOMM/llm/kvcomm_engine.py:694
↓ 5 callers
Method
_map_in_pool
(self, fn, iterable, timeout=None)
KVCOMM/llm/gpt_chat.py:872
↓ 5 callers
Function
_safe_seq_len
Best-effort sequence length from cache (APIs vary across transformers).
KVCOMM/llm/kvcomm_engine.py:155
↓ 5 callers
Function
configure_logging
Configure the logging settings for the application. Args: print_level (str): The logging level for console output. logfile_l
KVCOMM/utils/log.py:8
↓ 5 callers
Method
update_condition_anchor
Materialise condition KV cache for another agent and update anchors.
KVCOMM/llm/gpt_chat.py:567
↓ 4 callers
Function
_assign_stack_to_cache
Overwrite cache layers with stacked tensors maintaining per-layer metadata.
KVCOMM/llm/kvcomm_engine.py:100
↓ 4 callers
Function
_empty_like_tensor
(tensor: Optional[torch.Tensor])
KVCOMM/llm/kvcomm_engine.py:179
↓ 4 callers
Function
_set_layer_kv
Assign key/value tensors to a specific layer, updating metadata if present.
KVCOMM/llm/kvcomm_engine.py:51
↓ 4 callers
Method
apply_overrides
Return a copy with provided non-None fields overridden.
KVCOMM/llm/config.py:35
↓ 4 callers
Method
apply_rotary_pos_emb
Rotate placeholder cache keys by absolute offset (with optional drop).
KVCOMM/llm/kvcomm_engine.py:1190
↓ 4 callers
Method
arun
Asynchronous execution entry supporting standard and KV-reuse workflows.
KVCOMM/graph/graph.py:261
↓ 4 callers
Method
connect_decision_node
Connect every node to the decision node with a spatial edge.
KVCOMM/graph/graph.py:175
↓ 4 callers
Method
construct_spatial_connection
Rebuild spatial edges from masks while preventing cycles.
KVCOMM/graph/graph.py:180
↓ 4 callers
Method
construct_temporal_connection
Rebuild temporal edges for non-zero rounds from masks while preventing cycles.
KVCOMM/graph/graph.py:195
↓ 4 callers
Method
find_node
(self, id: str)
KVCOMM/graph/graph.py:122
↓ 4 callers
Function
get_combine_materials
(materials: Dict[str, Any], avoid_vague=True)
KVCOMM/prompt/common.py:5
↓ 4 callers
Method
get_decision_constraint
TODO
KVCOMM/prompt/prompt_set.py:65
↓ 4 callers
Method
get_decision_role
TODO
KVCOMM/prompt/prompt_set.py:70
↓ 4 callers
Method
get_role
TODO
KVCOMM/prompt/prompt_set.py:11
↓ 4 callers
Method
get_spatial_info
Return a dict that maps id to info.
KVCOMM/graph/node.py:123
↓ 4 callers
Method
get_temporal_info
(self, message=None, prefix=False)
KVCOMM/graph/node.py:139
↓ 4 callers
Method
instance
(cls)
KVCOMM/utils/globals.py:5
↓ 4 callers
Method
keys
(self)
KVCOMM/llm/kvcomm_engine.py:577
↓ 4 callers
Method
parse
To be overriden by the descendant class
KVCOMM/tools/reader/readers.py:28
↓ 4 callers
Method
predict_as_anchor
( self, candidate_kv_cache: DynamicCache, anchor_kv_cache_list: List[Dict], an
KVCOMM/llm/kvcomm_engine.py:991
↓ 4 callers
Method
reset
(self, prompt_length: int)
KVCOMM/llm/gpt_chat.py:93
↓ 4 callers
Function
slice
Returns a new TokenInput with input_ids and attention_mask sliced along the time dimension. Negative indexing is allowed.
KVCOMM/llm/token_ops.py:55
↓ 4 callers
Method
tokenize_segment
Tokenize a single chat segment and move tensors to the model device.
KVCOMM/llm/gpt_chat.py:472
↓ 4 callers
Method
update
(self, predicted: str, target: str)
experiments/accuracy.py:8
↓ 3 callers
Method
__init__
( self, id: str | None = None, domain: str = "", llm_name: str = "", l
KVCOMM/agents/final_decision.py:339
↓ 3 callers
Method
_build_chat_inputs
Tokenize chat messages and return model inputs, text, and prompt length.
KVCOMM/llm/gpt_chat.py:397
↓ 3 callers
Method
_process_inputs
Prepare prompts, optionally populate anchors, and return mode hints.
KVCOMM/agents/copy_machine.py:39
↓ 3 callers
Method
_process_inputs
To be overriden by the descendant class
KVCOMM/agents/final_decision.py:95
↓ 3 callers
Method
_process_inputs
To be overriden by the descendant class
KVCOMM/agents/final_decision.py:353
↓ 3 callers
Method
_process_inputs
Prepare prompts, run quick internal checks, and return mode hints.
KVCOMM/agents/code_writing.py:31
↓ 3 callers
Method
_process_inputs
Prepare prompts, optionally populate anchors, and return mode hints.
KVCOMM/agents/analyze_agent.py:41
↓ 3 callers
Method
_process_inputs
Prepare prompts, possibly set anchors, and return mode hints.
KVCOMM/agents/math_solver.py:30
↓ 3 callers
Method
add_successor
(self, operation: 'Node', st='spatial')
KVCOMM/graph/node.py:81
↓ 3 callers
Method
extract_example
(self, prompt: str)
KVCOMM/agents/code_writing.py:156
↓ 3 callers
Function
function_with_timeout
(func, args, timeout)
KVCOMM/tools/coding/executor_utils.py:34
↓ 3 callers
Method
get_request_state
Return per-request state used by the KV engine.
KVCOMM/llm/gpt_chat.py:537
↓ 3 callers
Method
log_cumulative
Log the cumulative average reuse rate across all processed requests.
KVCOMM/utils/metrics.py:175
↓ 3 callers
Method
read
(self, task, file)
KVCOMM/tools/reader/readers.py:334
↓ 3 callers
Function
search_wiki_main
(queries)
KVCOMM/tools/search/wiki.py:88
↓ 3 callers
Method
update_memory
Propagate memory update across nodes; supports multi-request keys.
KVCOMM/graph/graph.py:421
↓ 3 callers
Method
validate
Validate value ranges and return self.
KVCOMM/llm/config.py:44
↓ 2 callers
Function
_append_latency_record
Persist a latency record to JSON, tolerating malformed or missing files.
KVCOMM/llm/gpt_chat.py:63
↓ 2 callers
Method
_async_execute
To be overriden by the descendant class
KVCOMM/graph/node.py:267
↓ 2 callers
Function
_clone_default
(value: Any)
KVCOMM/llm/kvcomm_engine.py:532
↓ 2 callers
Function
_concat_inplace
In-place concatenate multiple caches along sequence dimension.
KVCOMM/llm/kvcomm_engine.py:303
↓ 2 callers
Function
_concat_tensors
( base: Optional[torch.Tensor], additions: Sequence[Optional[torch.Tensor]], )
KVCOMM/llm/kvcomm_engine.py:272
↓ 2 callers
Function
_elementwise_binary_op
Apply an elementwise binary op to two caches layer-by-layer.
KVCOMM/llm/kvcomm_engine.py:442
↓ 2 callers
Function
_ensure_cache_sequence
( caches: Union[DynamicCache, Sequence[DynamicCache], None] )
KVCOMM/llm/kvcomm_engine.py:293
↓ 2 callers
Function
_ensure_same_layout
(cache: DynamicCache, other: DynamicCache)
KVCOMM/llm/kvcomm_engine.py:185
↓ 2 callers
Function
_extract_boxed_content
Return the content inside a \\boxed expression, handling nested braces.
datasets/gsm8k_dataset.py:26
↓ 2 callers
Method
_is_python_code_block
(text: str)
KVCOMM/agents/final_decision.py:52
↓ 2 callers
Function
_layer_length
(tensor: Optional[torch.Tensor])
KVCOMM/llm/kvcomm_engine.py:133
↓ 2 callers
Function
_normalize_indices
Convert None/negative indices into bounded absolute [start, end).
KVCOMM/llm/kvcomm_engine.py:139
↓ 2 callers
Function
_normalize_slice_indices
Convert negative indices and None into concrete slice bounds.
KVCOMM/llm/token_ops.py:4
↓ 2 callers
Method
_render_base_messages
Render base messages from the current template with provided text.
KVCOMM/llm/gpt_chat.py:434
↓ 2 callers
Function
_replace_inplace
In-place replace [start, end) with the content from `real`.
KVCOMM/llm/kvcomm_engine.py:352
next →
1–100 of 446, ranked by callers