Repository Analysis

lm-sys/FastChat

An open platform for training, serving, and evaluating large language models. Release repo for Vicuna and Chatbot Arena.

13.0 Low AI signal View on GitHub
13.0
Adjusted Score
13.0
Raw Score
100%
Time Factor
2026-05-01
Last Push
39,485
Stars
Python
Language
48,283
Lines of Code
199
Files
586
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 8MEDIUM 49LOW 528

Pattern Findings

586 matches across 14 categories. Click a row to expand file-level details.

Unused Imports204 hits · 198 pts
SeverityFileLineSnippet
LOWplayground/test_embedding/test_sentence_similarity.py2
LOWtests/test_openai_api.py7
LOWtests/load_test.py3
LOWtests/load_test.py5
LOWtests/load_test.py6
LOWtests/test_cli.py2
LOWfastchat/conversation.py11
LOWfastchat/conversation.py13
LOWfastchat/model/monkey_patch_non_inplace.py6
LOWfastchat/model/model_exllama.py5
LOWfastchat/model/rwkv_model.py5
LOWfastchat/model/rwkv_model.py11
LOWfastchat/model/rwkv_model.py11
LOWfastchat/model/__init__.py1
LOWfastchat/model/__init__.py1
LOWfastchat/model/__init__.py1
LOWfastchat/model/apply_delta.py17
LOWfastchat/model/model_yuan2.py6
LOWfastchat/model/model_cllm.py4
LOWfastchat/model/model_cllm.py5
LOWfastchat/model/model_cllm.py7
LOWfastchat/model/model_cllm.py7
LOWfastchat/model/model_cllm.py7
LOWfastchat/model/model_cllm.py7
LOWfastchat/model/model_cllm.py7
LOWfastchat/model/model_cllm.py8
LOWfastchat/model/model_cllm.py8
LOWfastchat/model/model_cllm.py9
LOWfastchat/model/model_cllm.py9
LOWfastchat/model/model_cllm.py9
LOWfastchat/model/model_cllm.py9
LOWfastchat/model/model_cllm.py9
LOWfastchat/model/model_cllm.py9
LOWfastchat/model/model_cllm.py17
LOWfastchat/model/model_cllm.py18
LOWfastchat/model/model_falcon.py6
LOWfastchat/model/model_adapter.py277
LOWfastchat/model/model_codet5p.py4
LOWfastchat/train/train_lora_t5.py16
LOWfastchat/train/train_lora_t5.py17
LOWfastchat/train/train_lora_t5.py20
LOWfastchat/train/train_lora_t5.py21
LOWfastchat/train/train_lora_t5.py24
LOWfastchat/train/train_lora_t5.py24
LOWfastchat/train/train_lora_t5.py27
LOWfastchat/train/train_lora_t5.py30
LOWfastchat/train/train_lora_t5.py31
LOWfastchat/train/train_lora_t5.py35
LOWfastchat/train/train_lora_t5.py36
LOWfastchat/train/train_baichuan.py23
LOWfastchat/train/train_baichuan.py32
LOWfastchat/train/llama_flash_attn_monkey_patch.py5
LOWfastchat/train/train.py21
LOWfastchat/train/train.py23
LOWfastchat/train/train_yuan2.py21
LOWfastchat/train/train_yuan2.py23
LOWfastchat/train/train_yuan2.py30
LOWfastchat/train/train_with_template.py23
LOWfastchat/serve/gradio_web_server.py6
LOWfastchat/serve/gradio_web_server.py8
144 more matches not shown…
Hyper-Verbose Identifiers200 hits · 164 pts
SeverityFileLineSnippet
LOWplayground/benchmark/benchmark_api_provider.py25def sample_image_and_question(random_questions_dict, index):
LOWplayground/test_embedding/test_semantic_search.py40def create_embedding_data_frame(data_path, model, max_tokens=500):
LOWplayground/test_embedding/test_classification.py38def create_embedding_data_frame(data_path, model, max_tokens=500):
LOWtests/test_image_utils.py56 def test_dont_resize_if_less_than_max(self):
LOWtests/test_image_utils.py74 def test_resize_large_image_and_send_to_moderation_filter(self):
LOWtests/test_image_utils.py84 def test_dont_resize_if_max_image_size_is_none(self):
LOWtests/test_openai_api.py72def test_chat_completion_stream(model):
LOWtests/test_openai_vision_api.py97def test_chat_completion_stream(model):
LOWdocs/commands/webserver.md84def check_deprecated_parameters(
LOWfastchat/conversation.py383 def to_openai_vision_api_messages(self, is_mistral=False):
LOWfastchat/conversation.py492 def to_anthropic_vision_api_messages(self):
LOWfastchat/conversation.py641 def extract_text_and_image_hashes_from_messages(self):
LOWfastchat/utils.py458def image_moderation_provider(image, api_type):
LOWfastchat/model/monkey_patch_non_inplace.py117def replace_llama_attn_with_non_inplace_operations():
LOWfastchat/model/llama_condense_monkey_patch.py68def replace_llama_with_condense(ratio):
LOWfastchat/model/model_adapter.py2079 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2089 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2099 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2109 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2119 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2129 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2139 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2199 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2209 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2219 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2297 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2307 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2317 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2327 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2337 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2347 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2399 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2409 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py2419 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py143 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py175def raise_warning_for_incompatible_cpu_offloading_configuration(
LOWfastchat/model/model_adapter.py398def get_conversation_template(model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py404def get_generate_stream_function(model: torch.nn.Module, model_path: str):
LOWfastchat/model/model_adapter.py620def remove_parent_directory_name(model_path):
LOWfastchat/model/model_adapter.py688 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py723 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py728 def raise_warning_for_old_weights(self, model):
LOWfastchat/model/model_adapter.py748 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py796 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py829 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py841 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py869 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py894 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py918 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py929 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py950 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py964 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py974 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py997 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py1024 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py1048 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py1068 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py1080 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py1090 def get_default_conv_template(self, model_path: str) -> Conversation:
LOWfastchat/model/model_adapter.py1107 def get_default_conv_template(self, model_path: str) -> Conversation:
140 more matches not shown…
Deep Nesting80 hits · 78 pts
SeverityFileLineSnippet
LOWtests/load_test.py12
LOWtests/load_test.py66
LOWfastchat/conversation.py76
LOWfastchat/conversation.py330
LOWfastchat/conversation.py362
LOWfastchat/conversation.py383
LOWfastchat/conversation.py440
LOWfastchat/conversation.py464
LOWfastchat/conversation.py492
LOWfastchat/conversation.py532
LOWfastchat/conversation.py611
LOWfastchat/conversation.py641
LOWfastchat/utils.py152
LOWfastchat/utils.py379
LOWfastchat/model/apply_delta.py25
LOWfastchat/model/apply_delta.py70
LOWfastchat/model/model_yuan2.py13
LOWfastchat/model/model_cllm.py109
LOWfastchat/model/model_falcon.py13
LOWfastchat/model/model_adapter.py201
LOWfastchat/model/model_adapter.py404
LOWfastchat/model/model_adapter.py438
LOWfastchat/model/model_chatglm.py40
LOWfastchat/train/train_yuan2.py100
LOWfastchat/train/train_with_template.py112
LOWfastchat/train/train_with_template.py144
LOWfastchat/train/train_lora.py79
LOWfastchat/train/train_lora.py104
LOWfastchat/serve/gradio_web_server.py444
LOWfastchat/serve/model_worker.py185
LOWfastchat/serve/controller.py156
LOWfastchat/serve/launch_all_serve.py209
LOWfastchat/serve/gradio_block_arena_vision_named.py305
LOWfastchat/serve/cli.py110
LOWfastchat/serve/gradio_web_server_multi.py110
LOWfastchat/serve/gradio_web_server_multi.py169
LOWfastchat/serve/gradio_block_arena_vision_anony.py378
LOWfastchat/serve/inference.py62
LOWfastchat/serve/inference.py337
LOWfastchat/serve/gradio_block_arena_vision.py194
LOWfastchat/serve/gradio_block_arena_named.py224
LOWfastchat/serve/gradio_block_arena_named.py314
LOWfastchat/serve/call_monitor.py25
LOWfastchat/serve/api_provider.py18
LOWfastchat/serve/api_provider.py364
LOWfastchat/serve/api_provider.py428
LOWfastchat/serve/api_provider.py511
LOWfastchat/serve/api_provider.py846
LOWfastchat/serve/api_provider.py1272
LOWfastchat/serve/openai_api_server.py228
LOWfastchat/serve/openai_api_server.py266
LOWfastchat/serve/openai_api_server.py621
LOWfastchat/serve/gradio_block_arena_anony.py358
LOWfastchat/serve/gradio_block_arena_anony.py441
LOWfastchat/serve/dashinfer_worker.py96
LOWfastchat/serve/monitor/monitor.py147
LOWfastchat/serve/monitor/monitor.py917
LOWfastchat/serve/monitor/elo_analysis.py215
LOWfastchat/serve/monitor/elo_analysis.py239
LOWfastchat/serve/monitor/clean_battle_data.py116
20 more matches not shown…
Excessive Try-Catch Wrapping43 hits · 60 pts
SeverityFileLineSnippet
MEDIUMplayground/test_embedding/test_sentence_similarity.py28 print(f"Error: {response.status_code} - {response.text}")
MEDIUMplayground/test_embedding/test_semantic_search.py36 print(f"Error: {response.status_code} - {response.text}")
MEDIUMplayground/test_embedding/test_classification.py34 print(f"Error: {response.status_code} - {response.text}")
LOWtests/test_openai_api.py82 except Exception as e:
LOWtests/load_test.py59 except Exception as e:
MEDIUMtests/load_test.py12def litellm_completion(args, tokenizer, image_url=None):
LOWtests/test_openai_vision_api.py117 except Exception as e:
MEDIUMfastchat/model/model_exllama.py20 print(f"Error: Failed to load Exllamav2. {e}")
LOWfastchat/model/apply_delta.py64 except Exception as e:
MEDIUMfastchat/model/apply_delta.py65 print(f"An error occurred during split_files: {e}")
LOWfastchat/serve/gradio_web_server.py439 except Exception as e:
LOWfastchat/serve/gradio_web_server.py605 except Exception as e:
LOWfastchat/serve/remote_logger.py58 except Exception:
MEDIUMfastchat/serve/call_monitor.py40 print(f"Error decoding json: {json_file} {line}")
MEDIUMfastchat/serve/api_provider.py364def column_api_stream_iter(
MEDIUMfastchat/serve/api_provider.py1272def metagen_api_stream_iter(
LOWfastchat/serve/api_provider.py402 except Exception as e:
LOWfastchat/serve/api_provider.py420 except Exception as e:
LOWfastchat/serve/api_provider.py817 except Exception as e:
LOWfastchat/serve/api_provider.py838 except Exception as e:
LOWfastchat/serve/api_provider.py1016 except Exception as e:
LOWfastchat/serve/api_provider.py1342 except Exception as e:
LOWfastchat/serve/openai_api_server.py462 except Exception as e:
LOWfastchat/serve/openai_api_server.py596 except Exception as e:
LOWfastchat/serve/openai_api_server.py855 except Exception as e:
LOWfastchat/serve/huggingface_api_worker.py189 except Exception as e:
LOWfastchat/serve/dashinfer_worker.py201 except Exception as e:
LOWfastchat/serve/monitor/monitor.py907 except Exception as e:
MEDIUMfastchat/serve/monitor/monitor.py908 print(f"Error: {e}")
MEDIUMfastchat/serve/monitor/monitor.py883def get_model_name(model_key):
LOWfastchat/serve/monitor/classify/label.py85 except Exception as e:
LOWfastchat/serve/monitor/classify/label.py174 except Exception as e:
MEDIUMfastchat/serve/monitor/vote_time_stats/analyze_data.py42 print("Error: Key to GC does not exist.")
LOWfastchat/serve/monitor/vote_time_stats/analyze_data.py91 except Exception:
LOWfastchat/serve/monitor/vote_time_stats/analyze_data.py102 except Exception as e:
MEDIUMfastchat/modules/xfastertransformer.py29 print(f"Error: Failed to load xFasterTransformer. {e}")
MEDIUMfastchat/modules/awq.py31 print(f"Error: Failed to import tinychat. {e}")
MEDIUMfastchat/modules/awq.py84 print("Error: AWQ checkpoint not found")
MEDIUMfastchat/modules/gptq.py39 print(f"Error: Failed to load GPTQ-for-LLaMa. {e}")
MEDIUMfastchat/modules/gptq.py74 print("Error: gptq checkpoint not found")
MEDIUMfastchat/modules/exllama.py29 print(f"Error: Failed to load Exllamav2. {e}")
LOWfastchat/data/optional_replace.py49 except Exception as e:
LOWfastchat/llm_judge/common.py516 except Exception as e:
Slop Phrases26 hits · 48 pts
SeverityFileLineSnippet
MEDIUMfastchat/data/hardcoded_questions.py46 f"You can call me {name}, and I was trained by {org} researchers as a language model.",
MEDIUMfastchat/data/hardcoded_questions.py47 f"As a language model, I go by the name {name} and was trained by researchers from {org}.",
MEDIUMdata/dummy_conversation.json53 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json74 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json179 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json200 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json305 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json326 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json431 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json452 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json557 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json578 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json683 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json704 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json809 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json830 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json935 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json956 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json1061 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json1082 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json1187 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json1208 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json1313 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json1334 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
MEDIUMdata/dummy_conversation.json1439 "value": "You can call me Vicuna, and I was trained by Large Model Systems Organization (LMSYS) researchers as a
MEDIUMdata/dummy_conversation.json1460 "value": "As a language model, I go by the name Vicuna and was trained by researchers from Large Model Systems O
Cross-File Repetition5 hits · 25 pts
SeverityFileLineSnippet
HIGHfastchat/train/train_baichuan.py0make dataset and collator for supervised fine-tuning.
HIGHfastchat/train/train.py0make dataset and collator for supervised fine-tuning.
HIGHfastchat/train/train_yuan2.py0make dataset and collator for supervised fine-tuning.
HIGHfastchat/train/train_with_template.py0make dataset and collator for supervised fine-tuning.
HIGHfastchat/train/train_flant5.py0make dataset and collator for supervised fine-tuning.
Self-Referential Comments5 hits · 15 pts
SeverityFileLineSnippet
MEDIUMtests/test_image_utils.py35 # Create an image from the pixel data
MEDIUMfastchat/model/rwkv_model.py43 # This function is used by fastchat.llm_judge.
MEDIUMfastchat/serve/cli.py115 # Create a Live context for updating the console output
MEDIUMfastchat/serve/monitor/vote_time_stats/plot.py24# Define the new cutoff and number of bins
MEDIUMfastchat/serve/monitor/vote_time_stats/plot.py41# Create the plot with custom bins
Over-Commented Block13 hits · 12 pts
SeverityFileLineSnippet
LOWfastchat/model/model_adapter.py641 from peft import PeftConfig, PeftModel
LOWfastchat/train/train_lora_t5.py1# Adapted from tatsu-lab@stanford_alpaca. Below is the original copyright:
LOWfastchat/train/train_baichuan.py1# This code is based on tatsu-lab/stanford_alpaca. Below is the original copyright:
LOWfastchat/train/train.py1# This code is based on tatsu-lab/stanford_alpaca. Below is the original copyright:
LOWfastchat/train/train_yuan2.py1# This code is based on tatsu-lab/stanford_alpaca. Below is the original copyright:
LOWfastchat/train/train_with_template.py1# This code is based on tatsu-lab/stanford_alpaca. Below is the original copyright:
LOWfastchat/train/train_flant5.py1# Adapted from tatsu-lab@stanford_alpaca. Below is the original copyright:
LOWfastchat/train/train_lora.py1# Usage: deepspeed train_lora.py --deepspeed <$PATH_TO_DEEPSPEED_CONFIG>
LOWfastchat/serve/gradio_web_server.py741 width: 100%;
LOWfastchat/serve/gradio_web_server.py761# }
LOWfastchat/serve/gradio_web_server.py781# #ack_markdown .prose {
LOWfastchat/serve/gradio_web_server.py801# margin-top: 8px; /* Adjust the value as needed */
LOWfastchat/serve/cli.py121 text = outputs["text"]
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALfastchat/serve/api_provider.py528 thread_message = client.beta.threads.messages.with_raw_response.create(
Cross-Language Confusion2 hits · 8 pts
SeverityFileLineSnippet
HIGHfastchat/model/model_adapter.py1760 cd flash-attention && pip install .
HIGHfastchat/serve/gradio_web_server_multi.py185function gtag(){{dataLayer.push(arguments);}}
Redundant / Tautological Comments3 hits · 4 pts
SeverityFileLineSnippet
LOWfastchat/serve/huggingface_api.py54 # Print results
LOWfastchat/serve/inference.py448 # Set inp to previous message
LOWfastchat/serve/inference.py483 # Check if file exists and add .json if needed
Synthetic Comment Markers1 hit · 2 pts
SeverityFileLineSnippet
HIGHfastchat/data/extract_gpt4_only.py2Extract the conversations generated by GPT-4 only.
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippet
LOWfastchat/serve/monitor/clean_battle_data.py140def process_data(
LOWfastchat/serve/monitor/clean_chat_data.py74def process_data(row, action_type):
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWtests/test_openai_langchain.py1# Usage: