AirLLM 70B inference with single 4GB GPU
This report summarizes scanner evidence for lyogavin/airllm, a Jupyter Notebook project with 35,956 GitHub stars. SynthScan examined 11,776 lines of code across 63 source files, recording 190 pattern matches distributed across 10 syntactic categories. The legacy adjusted pattern signal is 20.9 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 106 finding(s).
Are imports declared and package/API names verified? 50 finding(s).
Are wrappers, guards, and repeated structures necessary? 111 finding(s).
Which changes need focused human review? 190 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 190 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/qlora.py | 381 | def print_trainable_parameters(args, model): | CODE |
| LOW | training/qlora.py | 398 | def smart_tokenizer_and_embedding_resize( | CODE |
| LOW | training/qlora.py | 473 | def extract_unnatural_instructions_data(examples, extract_reformulations=False): | CODE |
| LOW⚡ | air_llm/tests/test_kimi_k3_split.py | 110 | def test_every_module_is_split_out(self): | CODE |
| LOW⚡ | air_llm/tests/test_kimi_k3_split.py | 118 | def test_one_shard_per_layer_is_linked_not_copied(self): | CODE |
| LOW⚡ | air_llm/tests/test_kimi_k3_split.py | 126 | def test_projector_and_vision_tower_are_linked(self): | CODE |
| LOW⚡ | air_llm/tests/test_kimi_k3_split.py | 132 | def test_shared_shard_modules_are_materialised_separately(self): | CODE |
| LOW | air_llm/tests/test_kimi_k3_split.py | 145 | def test_contents_match_the_original_checkpoint(self): | CODE |
| LOW | air_llm/tests/test_kimi_k3_split.py | 203 | def test_all_modules_written_as_real_files(self): | CODE |
| LOW | air_llm/tests/test_compression.py | 18 | def test_should_compress_uncompress(self): | CODE |
| LOW | air_llm/tests/test_automodel.py | 16 | def test_auto_model_should_return_correct_model(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 33 | def test_base_is_frozen_adapters_train(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 55 | def test_inject_and_roundtrip_state(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 76 | def test_matches_full_cross_entropy(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 98 | def test_batched_shape_and_cpu_weight(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 154 | def test_streamed_lora_matches_resident_grads(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 198 | def test_base_frozen_and_loss_drops(self): | CODE |
| LOW | air_llm/tests/test_streamed_lora.py | 221 | def test_inject_by_class_name(self): | CODE |
| LOW | air_llm/tests/test_qwen3_8_split.py | 114 | def test_every_streamed_and_resident_module_is_split_out(self): | CODE |
| LOW | air_llm/tests/test_qwen3_8_split.py | 122 | def test_vision_tower_is_one_shard_and_excludes_decoder_weights(self): | CODE |
| LOW | air_llm/tests/test_qwen3_8_split.py | 139 | def test_decoder_and_head_round_trip(self): | CODE |
| LOW | air_llm/tests/test_qwen3_8_split.py | 154 | def test_shared_shards_are_copied_not_linked(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 123 | def test_file_loader_concatenates_without_keeping_shard_keys(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 143 | def test_rejects_gapped_shard_indices(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 150 | def test_marker_discovers_the_parent_layer(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 187 | def test_every_streamed_and_resident_module_is_split_out(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 197 | def test_ngram_table_is_peeled_out_of_its_decoder_layer(self): | CODE |
| LOW⚡ | air_llm/tests/test_qwen38_flash_next_split.py | 212 | def test_packed_experts_stay_on_the_decoder_layer(self): | CODE |
| LOW⚡ | air_llm/tests/test_qwen38_flash_next_split.py | 218 | def test_output_mix_is_the_norm_slot(self): | CODE |
| LOW⚡ | air_llm/tests/test_qwen38_flash_next_split.py | 223 | def test_vision_tower_is_one_shard_and_excludes_decoder_weights(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 258 | def test_shared_shards_are_copied_not_linked(self): | CODE |
| LOW | air_llm/tests/test_qwen38_flash_next_split.py | 271 | def test_huge_embedding_is_born_on_meta(self): | CODE |
| LOW | air_llm/airllm/airllm_chatglm.py | 16 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/airllm_chatglm.py | 25 | def get_past_key_values_cache_seq_len(self, past_key_values): | CODE |
| LOW | air_llm/airllm/lora_linear.py | 167 | def inject_packed_expert_lora(module, r=16, alpha=32, device=None, dtype=None): | CODE |
| LOW | air_llm/airllm/airllm_internlm.py | 16 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/airllm_qwen.py | 16 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/airllm_qwen.py | 22 | def get_past_key_values_cache_seq_len(self, past_key_values): | CODE |
| LOW | air_llm/airllm/airllm_baichuan.py | 18 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 41 | def restore_relocated_transformers_symbols(): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 231 | def _propagate_attn_implementation(self, impl): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 251 | def _model_matches_layer_names(self, model): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 404 | def set_layers_from_layer_names(self): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 459 | def _restore_plain_weight_modules(self, state_dict): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 657 | def _param_names_from_state_dict(self, state_dict): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 713 | def _load_cpu_resident_modules(self): | CODE |
| LOW | air_llm/airllm/airllm_mistral.py | 16 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/airllm_qwen2.py | 17 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/utils.py | 88 | def uncompress_layer_state_dict(layer_state_dict): | CODE |
| LOW | air_llm/airllm/utils.py | 132 | def merge_ngram_embedding_shards(state_dict): | CODE |
| LOW | air_llm/airllm/utils.py | 158 | def load_merged_ngram_embedding(local_path, layer_name): | CODE |
| LOW | air_llm/airllm/utils.py | 379 | def cpu_resident_module_names(layer_names, index_keys): | CODE |
| LOW | air_llm/airllm/utils.py | 470 | def compress_layer_state_dict(layer_state_dict, compression=None): | CODE |
| LOW | air_llm/airllm/utils.py | 491 | def remove_real_and_linked_file(to_delete): | CODE |
| LOW | air_llm/airllm/utils.py | 793 | def find_or_create_local_splitted_path(model_local_path_or_repo_id, layer_shards_saving_path=None, compression=None, | CODE |
| LOW | air_llm/airllm/tokenization_baichuan.py | 172 | def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None): | CODE |
| LOW | air_llm/airllm/tokenization_baichuan.py | 220 | def create_token_type_ids_from_sequences( | CODE |
| LOW | air_llm/airllm/airllm_mixtral.py | 16 | def get_use_better_transformer(self): | CODE |
| LOW | air_llm/airllm/chunked_ce.py | 121 | def chunked_linear_cross_entropy( | CODE |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 53 | def get_model_args_from_config(config): | CODE |
| 9 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/qlora.py | 4 | CODE | |
| LOW | air_llm/tests/test_automodel.py | 1 | CODE | |
| LOW | air_llm/airllm/__init__.py | 9 | CODE | |
| LOW | air_llm/airllm/__init__.py | 10 | CODE | |
| LOW | air_llm/airllm/__init__.py | 14 | CODE | |
| LOW | air_llm/airllm/__init__.py | 15 | CODE | |
| LOW | air_llm/airllm/__init__.py | 16 | CODE | |
| LOW | air_llm/airllm/__init__.py | 17 | CODE | |
| LOW | air_llm/airllm/lora_data.py | 3 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 2 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 2 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 2 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 2 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 3 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 24 | CODE | |
| LOW | air_llm/airllm/airllm_qwen2.py | 2 | CODE | |
| LOW | air_llm/airllm/utils.py | 12 | CODE | |
| LOW | air_llm/airllm/utils.py | 14 | CODE | |
| LOW | air_llm/airllm/utils.py | 14 | CODE | |
| LOW | air_llm/airllm/utils.py | 14 | CODE | |
| LOW | air_llm/airllm/utils.py | 14 | CODE | |
| LOW | air_llm/airllm/utils.py | 14 | CODE | |
| LOW | air_llm/airllm/utils.py | 26 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 2 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 3 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 4 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 8 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 13 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 16 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 16 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 16 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 16 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 16 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 17 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 17 | CODE | |
| LOW | air_llm/airllm/persist/__init__.py | 1 | CODE | |
| LOW | air_llm/airllm/persist/mlx_model_persister.py | 10 | CODE | |
| LOW | air_llm/airllm/persist/mlx_model_persister.py | 12 | CODE | |
| LOW | rlhf/qlora_dpo.py | 4 | CODE | |
| LOW | rlhf/qlora_dpo.py | 5 | CODE | |
| LOW | rlhf/qlora_dpo.py | 13 | CODE | |
| LOW | rlhf/qlora_dpo.py | 43 | CODE | |
| LOW | rlhf/qlora_dpo.py | 43 | CODE | |
| LOW | rlhf/qlora_dpo.py | 43 | CODE | |
| LOW | scripts/test_cn_dataset_lenghts.py | 3 | CODE | |
| LOW | anima_100k/longer_training.py | 4 | CODE | |
| LOW | anima_100k/longer_training.py | 22 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 21 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 38 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 38 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | air_llm/airllm/airllm_base.py | 453 | except RuntimeError: | CODE |
| HIGH | air_llm/airllm/utils.py | 82 | except Exception as ex: | CODE |
| HIGH | air_llm/airllm/utils.py | 517 | except OSError: | CODE |
| HIGH | air_llm/airllm/utils.py | 522 | except OSError: | CODE |
| HIGH | air_llm/airllm/utils.py | 679 | except ValueError: | CODE |
| HIGH | air_llm/airllm/utils.py | 707 | except ValueError: | CODE |
| HIGH | anima_100k/longer_training.py | 95 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | training/qlora.py | 0 | prints the number of trainable parameters in the model. | STRING |
| HIGH | rlhf/qlora_dpo.py | 0 | prints the number of trainable parameters in the model. | STRING |
| HIGH | anima_100k/longer_training.py | 0 | prints the number of trainable parameters in the model. | STRING |
| HIGH | training/qlora.py | 0 | resize tokenizer and embedding. note: this is the unoptimized version that may make your embedding size not be divisible | STRING |
| HIGH | rlhf/qlora_dpo.py | 0 | resize tokenizer and embedding. note: this is the unoptimized version that may make your embedding size not be divisible | STRING |
| HIGH | anima_100k/longer_training.py | 0 | resize tokenizer and embedding. note: this is the unoptimized version that may make your embedding size not be divisible | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | air_llm/airllm/airllm_lora.py | 299 | except Exception as e: # noqa: BLE001 - fall back to the layer's is_causal path | CODE |
| LOW | air_llm/airllm/airllm_lora.py | 501 | except Exception as e: # noqa: BLE001 | CODE |
| MEDIUM | air_llm/airllm/airllm_lora.py | 279 | def _make_masks(self, hidden_shape, attention_mask, text_position_ids): | CODE |
| MEDIUM | air_llm/airllm/airllm_lora.py | 373 | def load_adapter(self, path): | CODE |
| LOW | air_llm/airllm/__init__.py | 43 | except Exception as _e: # noqa: BLE001 - optional family, keep package importable | CODE |
| MEDIUM | air_llm/airllm/airllm_base.py | 217 | def get_generation_config(self): | CODE |
| LOW | air_llm/airllm/airllm_base.py | 161 | except Exception: | CODE |
| LOW | air_llm/airllm/airllm_base.py | 220 | except Exception: | CODE |
| LOW | air_llm/airllm/airllm_base.py | 314 | except Exception as e: # noqa: BLE001 - try the next factory | CODE |
| LOW | air_llm/airllm/airllm_base.py | 317 | except Exception as e: # noqa: BLE001 - try the next factory | CODE |
| LOW | air_llm/airllm/airllm_base.py | 340 | except Exception as e: | CODE |
| LOW | air_llm/airllm/airllm_base.py | 809 | except Exception: | CODE |
| LOW | air_llm/airllm/utils.py | 82 | except Exception as ex: | CODE |
| LOW | air_llm/airllm/persist/mlx_model_persister.py | 111 | except Exception as ex: | CODE |
| MEDIUM | air_llm/airllm/persist/mlx_model_persister.py | 91 | def load_model(self, layer_name, path): | CODE |
| LOW | rlhf/qlora_dpo.py | 588 | except Exception: | CODE |
| LOW | rlhf/qlora_dpo.py | 733 | except Exception as e: | CODE |
| LOW | anima_100k/longer_training.py | 95 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/qlora.py | 306 | CODE | |
| LOW | training/qlora.py | 473 | CODE | |
| LOW | training/qlora.py | 510 | CODE | |
| LOW | training/qlora.py | 525 | CODE | |
| LOW | training/qlora.py | 549 | CODE | |
| LOW | training/qlora.py | 579 | CODE | |
| LOW | air_llm/tests/test_compression.py | 18 | CODE | |
| LOW | air_llm/airllm/lora_data.py | 76 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 296 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 429 | CODE | |
| LOW | air_llm/airllm/utils.py | 88 | CODE | |
| LOW | air_llm/airllm/utils.py | 223 | CODE | |
| LOW | air_llm/airllm/utils.py | 528 | CODE | |
| LOW | rlhf/qlora_dpo.py | 354 | CODE | |
| LOW | rlhf/qlora_dpo.py | 516 | CODE | |
| LOW | rlhf/qlora_dpo.py | 553 | CODE | |
| LOW | scripts/gen_star_history.py | 46 | CODE | |
| LOW | anima_100k/longer_training.py | 83 | CODE | |
| LOW | anima_100k/longer_training.py | 368 | CODE | |
| LOW | anima_100k/longer_training.py | 546 | CODE | |
| LOW | anima_100k/longer_training.py | 583 | CODE | |
| LOW | anima_100k/longer_training.py | 598 | CODE | |
| LOW | anima_100k/longer_training.py | 627 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 948 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | air_llm/airllm/airllm_lora.py | 90 | CODE | |
| LOW | air_llm/airllm/airllm_lora.py | 397 | CODE | |
| LOW | air_llm/airllm/airllm_base.py | 84 | CODE | |
| LOW | air_llm/airllm/tokenization_baichuan.py | 57 | CODE | |
| LOW | air_llm/airllm/airllm_llama_mlx.py | 210 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 624 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 772 | CODE | |
| LOW | anima_100k/modeling_flash_llama.py | 948 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | air_llm/airllm/tokenization_baichuan.py | 1 | # Copyright 2023 Baichuan Inc. All Rights Reserved. | COMMENT |
| LOW | .github/workflows/release.yml | 1 | name: Publish to PyPI | COMMENT |
| LOW | .github/workflows/star-history.yml | 1 | name: Refresh Star History | COMMENT |
| LOW | anima_100k/modeling_flash_llama.py | 1 | # coding=utf-8 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | training/qlora.py | 60 | logger = logging.getLogger(__name__) | CODE |
| LOW | rlhf/qlora_dpo.py | 62 | logger = logging.getLogger(__name__) | CODE |
| LOW | anima_100k/longer_training.py | 60 | logger = logging.getLogger(__name__) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | anima_100k/extened_longchat_topiced_conversations.json | 1 | [{"TOPIC_ID": 1, "TOPIC": "The psychology of happiness", "CONVERSATION": "USER: I would like to discuss the topic of the | CODE |