repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
sglang
python/sglang/srt/models/qwen3_next_mtp.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
153
6,274
sglang
python/sglang/srt/models/kimi_k25_eagle3.py
.py
"""EAGLE3 / EAGLE3.1 draft model with MLA attention for Kimi-K2.x. The ``kimi-k2.5-eagle3-mla`` checkpoint pairs an EAGLE3 layout (concatenated [embed_norm, hidden_norm] pre-attention input, fc projection over the concatenated multi-layer aux hidden states, single decoder layer, dense MLP) with DeepSeek-V2 multi-laten...
521
21,004
sglang
python/sglang/srt/models/gemma2_reward.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
76
2,791
sglang
python/sglang/srt/models/gemma3_causal.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
1,088
41,523
sglang
python/sglang/srt/models/internlm2_reward.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
70
2,695
sglang
python/sglang/srt/models/glmasr.py
.py
# Copyright 2023-2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
172
6,085
sglang
python/sglang/srt/models/mistral.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
196
8,163
sglang
python/sglang/srt/models/deepseek_vl2.py
.py
from typing import Iterable, List, Optional, Tuple import torch import torch.nn.functional as F from einops import rearrange, repeat from torch import nn from sglang.srt.configs.deepseekvl2 import ( DeepseekVL2Config, DeepseekVL2MlpProjectorConfig, ) from sglang.srt.layers.linear import ReplicatedLinear from ...
371
13,368
sglang
python/sglang/srt/models/interns2preview.py
.py
# Models from sglang.srt.models.qwen3_5 import Qwen3_5MoeForConditionalGeneration class InternS2PreviewForConditionalGeneration(Qwen3_5MoeForConditionalGeneration): """InternS2Preview Vision-Language Model.""" EntryClass = [InternS2PreviewForConditionalGeneration]
10
273
sglang
python/sglang/srt/models/mimo.py
.py
# Adapted from qwen2.py from typing import Iterable, Optional, Tuple import torch from torch import nn from sglang.srt.layers.logits_processor import LogitsProcessor from sglang.srt.layers.pooler import Pooler, PoolingType from sglang.srt.layers.quantization.base_config import QuantizationConfig from sglang.srt.laye...
161
5,662
sglang
python/sglang/srt/models/qwen2_moe.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
1,257
47,834
sglang
python/sglang/srt/models/persimmon.py
.py
from collections.abc import Iterable from typing import Optional import torch from torch import nn from transformers import PersimmonConfig from sglang.srt.distributed import get_pp_group from sglang.srt.layers.activation import get_act_fn from sglang.srt.layers.linear import ( ColumnParallelLinear, QKVParall...
332
11,261
sglang
python/sglang/srt/models/voxtral.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from: # https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/voxtral.py # https://huggingface.co/mistralai/Voxtral-Mini-3B-2507 # # Copyright 2025 Mistral AI and the HuggingFace Inc....
447
17,127
sglang
python/sglang/srt/models/step3p5.py
.py
from typing import Any, Dict, Iterable, Optional, Tuple, Union import torch import torch.nn.functional as F from torch import nn from sglang.srt.distributed import ( get_pp_group, tensor_model_parallel_all_reduce, ) from sglang.srt.eplb.expert_distribution import get_global_expert_distribution_recorder from s...
1,040
40,365
sglang
python/sglang/srt/models/olmo2.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
486
16,947
sglang
python/sglang/srt/models/orion.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from # https://huggingface.co/OrionStarAI/Orion-14B-Base/blob/main/modeling_orion.py # Copyright (c) OrionStar Inc. # LICENSE: https://huggingface.co/OrionStarAI/Orion-14B-Base/blob/main/LICENSE # Adapt...
371
13,020
sglang
python/sglang/srt/models/arcee.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
531
18,815
sglang
python/sglang/srt/models/step3p7.py
.py
from typing import Iterable, List, Optional, Tuple import torch from torch import nn from transformers.activations import ACT2FN from sglang.srt.configs.step3p7 import Step3p7Config from sglang.srt.layers.linear import ColumnParallelLinear from sglang.srt.layers.quantization.base_config import QuantizationConfig from...
201
8,003
sglang
python/sglang/srt/models/granitemoe.py
.py
"""Inference-only GraniteMoe model.""" from typing import Iterable, Optional import torch from torch import nn from transformers import GraniteConfig from sglang.srt.layers.layernorm import RMSNorm from sglang.srt.layers.linear import ( QKVParallelLinear, ReplicatedLinear, RowParallelLinear, ) from sglan...
388
13,743
sglang
python/sglang/srt/models/qwen3_vl_moe.py
.py
# Copyright 2025 Qwen Team # Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
389
16,056
sglang
python/sglang/srt/models/longcat_flash_nextn.py
.py
# Apache License, Version 2.0: # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
687
29,244
sglang
python/sglang/srt/models/phi4mm_audio.py
.py
# Copyright 2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
1,261
48,877
sglang
python/sglang/srt/models/qwen3_omni_moe.py
.py
# Copyright 2025 Qwen Team # Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
734
27,912
sglang
python/sglang/srt/models/qwen3_5_text.py
.py
# Copyright 2025 Qwen Team # Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
226
8,174
sglang
python/sglang/srt/models/minimax_m3.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
1,822
70,848
sglang
python/sglang/srt/models/mimo_v2_nextn.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
398
14,732
sglang
python/sglang/srt/models/gpt_oss.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
1,425
53,805
sglang
python/sglang/srt/models/apertus.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2025 The SwissAI Initiative # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
682
25,095
sglang
python/sglang/srt/models/gpt2.py
.py
# coding=utf-8 # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/gpt2/modeling_gpt2.py # Copyright 2023 The vLLM team. # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under th...
290
9,791
sglang
python/sglang/srt/models/ernie45_moe_vl.py
.py
# Copyright 2023-2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
553
20,620
sglang
python/sglang/srt/models/mimo_v2_asr.py
.py
"""MiMo-V2-ASR model. Reuses the LM scaffold of ``MiMoForCausalLM`` and adds audio encoder components via ``AudioEncoderMixin``. The encoder modules are attached as top-level attributes (no ``audio_encoder.`` prefix) so the checkpoint state_dict aligns 1:1 with ``self.named_parameters()``. """ import logging from typ...
131
4,685
sglang
python/sglang/srt/models/qwen2.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
770
28,482
sglang
python/sglang/srt/models/bailing_moe_nextn.py
.py
# coding=utf-8 # Copyright 2023 Antgroup and The HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # and OPT implementations in this library. It has been modified from its # original forms to accommodate minor architectural differences compared # to GPT...
256
9,307
sglang
python/sglang/srt/models/xverse.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
385
14,113
sglang
python/sglang/srt/models/qwen2_vl.py
.py
# coding=utf-8 # Adapted from # https://github.com/huggingface/transformers/blob/19e6e80e10118f855137b90740936c0b11ac397f/src/transformers/models/qwen2_vl/modeling_qwen2_vl.py # Copyright 2024 The Qwen team. # Copyright 2023 The vLLM team. # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. ...
636
22,101
sglang
python/sglang/srt/models/ernie4.py
.py
# Copyright 2023-2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
434
16,322
sglang
python/sglang/srt/models/ernie4_eagle.py
.py
# Copyright 2023-2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
204
7,221
sglang
python/sglang/srt/models/glm4_moe_lite_nextn.py
.py
# Copyright 2026-2027 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
183
6,571
sglang
python/sglang/srt/models/qwen3_5_mtp.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
436
16,363
sglang
python/sglang/srt/models/dflash.py
.py
# Adapted from the DFlash reference implementation (HF) but implemented with # SGLang primitives (RadixAttention + SGLang KV cache). This model intentionally # does not include token embeddings or an LM head; DFlash uses the target model's # embedding/lm_head. from __future__ import annotations import logging from ty...
633
25,323
sglang
python/sglang/srt/models/dbrx.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
469
16,142
sglang
python/sglang/srt/models/step3_vl.py
.py
import logging import math from math import sqrt from typing import Any, Dict, Iterable, List, Optional, Tuple import torch from torch import nn from torch.nn import LayerNorm from torch.nn import functional as F from transformers import PretrainedConfig from transformers.activations import ACT2FN from sglang.srt.con...
1,049
37,756
sglang
python/sglang/srt/models/gemma2.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
503
17,458
sglang
python/sglang/srt/models/glm4.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
633
23,070
sglang
python/sglang/srt/models/deepseek_ocr.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2025 The SwissAI Initiative # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
1,923
68,110
sglang
python/sglang/srt/models/sarashina2_vision.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
269
10,913
sglang
python/sglang/srt/models/opt.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
638
23,348
sglang
python/sglang/srt/models/interns1pro.py
.py
import functools import logging from typing import Any, Dict, Iterable, Optional, Tuple import torch from transformers import PretrainedConfig from sglang.srt.layers.moe.topk import TopK from sglang.srt.layers.quantization.base_config import QuantizationConfig from sglang.srt.layers.rotary_embedding import get_rope f...
253
9,157
sglang
python/sglang/srt/models/gemma3n_mm.py
.py
import logging import re from functools import lru_cache from typing import Iterable, List, Optional, Set, Tuple, TypedDict, Union import torch from torch import nn from transformers import ( Gemma3nAudioConfig, Gemma3nConfig, Gemma3nTextConfig, Gemma3nVisionConfig, PreTrainedModel, ) from transfor...
534
20,317
sglang
python/sglang/srt/models/qwen3_next.py
.py
import enum import logging from typing import Any, Iterable, Optional, Set, Tuple import torch import triton from torch import nn from sglang.kernels.ops.attention.fla.fused_norm_gate import FusedRMSNormGated from sglang.kernels.ops.attention.fla.layernorm_gated import RMSNorm as RMSNormGated from sglang.kernels.ops....
1,294
48,003
sglang
python/sglang/srt/models/gpt_j.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
330
10,906
sglang
python/sglang/srt/models/sdar_moe.py
.py
# coding=utf-8 """ SGLang SDARMoeModelLM (block diffusion / dLLM-style forward) with MoE MLP. """ import logging from typing import Iterable, Optional, Tuple, Union import torch from torch import nn from transformers import PretrainedConfig from sglang.srt.distributed import ( get_pp_group, tensor_model_para...
732
25,224
sglang
python/sglang/srt/models/step3_vl_10b.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """This is basically a copy from perception_models/core/vision_encoder/pe.py""" from functools import partial from typing import Callable, Iterable, List, Optional, Tuple import torch from einops import rearrang...
634
22,864
sglang
python/sglang/srt/models/mimo_mtp.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/vllm-project/vllm/pull/17433/files and deepseek_nextn.py from typing import Iterable, Optional, Tuple import torch from torch import nn from transformers import PretrainedConfi...
207
7,384
sglang
python/sglang/srt/models/paddleocr_vl.py
.py
# Reference: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleocr-genai-vllm-server:latest # Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
741
25,815
sglang
python/sglang/srt/models/gemma4_mtp.py
.py
# Copyright 2026 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
405
15,960
sglang
python/sglang/srt/models/zaya.py
.py
# SPDX-License-Identifier: Apache-2.0 # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
1,656
67,866
sglang
python/sglang/srt/models/siglip2.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2026 Liquid AI. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of th...
608
21,465
sglang
python/sglang/srt/models/exaone_moe_mtp.py
.py
# Copyright 2025 The LG AI Research Team # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
107
3,820
sglang
python/sglang/srt/models/minicpmv_vit.py
.py
# Copyright 2026 The SGLang team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 """Vision Transformer for MiniCPM-V 4.6. Compared to 4.5 ...
551
20,937
sglang
python/sglang/srt/models/qwen3_classification.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
152
5,747
sglang
python/sglang/srt/models/kimi_vl_moonvit.py
.py
# SPDX-License-Identifier: Apache-2.0 # ruff: noqa: E501 # Adapted from https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/blob/main/modeling_kimi_vl.py # Shared MoonViT building blocks for kimi_vl.py and kimi_k25.py # Copyright 2025 The Moonshot AI Team, DeepSeek-AI, and HuggingFace Inc. team. All rights reserved....
694
25,890
sglang
python/sglang/srt/models/mistral_large_3_eagle.py
.py
# Adapted from https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/mistral_large_3_eagle.py # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project from typing import Optional import torch from transformers import PretrainedConfig from sglang.sr...
84
3,153
sglang
python/sglang/srt/models/gemma4_vision.py
.py
# Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
599
21,881
sglang
python/sglang/srt/models/llama_eagle3.py
.py
""" Copyright 2023-2024 SGLang Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwar...
377
14,017
sglang
python/sglang/srt/models/llama.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
936
34,803
sglang
python/sglang/srt/models/whisper.py
.py
from __future__ import annotations from array import array from typing import Any, Iterable, Optional, Tuple import torch from transformers import WhisperConfig from sglang.srt.layers.activation import get_act_fn from sglang.srt.layers.linear import ( ColumnParallelLinear, QKVParallelLinear, RowParallelL...
494
18,434
sglang
python/sglang/srt/models/exaone4.py
.py
from collections.abc import Iterable from typing import Any, List, Optional, Tuple, Union import torch from torch import nn from transformers import Exaone4Config from sglang.srt.distributed import get_pp_group from sglang.srt.layers.activation import SiluAndMul from sglang.srt.layers.layernorm import RMSNorm from sg...
714
25,371
sglang
python/sglang/srt/models/xverse_moe.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
482
17,207
sglang
python/sglang/srt/models/teleflm.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # Copyright 2023 The vLLM team. # Copyright 2022 EleutherAI and the HuggingFace Inc. team....
105
3,972
sglang
python/sglang/srt/models/glm4_moe_nextn.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
168
6,015
sglang
python/sglang/srt/models/minimax_m3_vl.py
.py
# SPDX-License-Identifier: Apache-2.0 import logging from typing import Iterable, List, Optional, Tuple import torch import torch.nn as nn from sglang.srt.distributed import ( get_pp_group, ) from sglang.srt.layers.logits_processor import LogitsProcessor from sglang.srt.layers.moe.utils import ( get_moe_a2a_...
423
16,080
sglang
python/sglang/srt/models/torch_native_llama.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
507
18,502
sglang
python/sglang/srt/models/mellum.py
.py
# Copyright 2023-2026 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
596
21,183
sglang
python/sglang/srt/models/roberta.py
.py
# SPDX-License-Identifier: Apache-2.0 import os from typing import Iterable, Optional, Tuple import torch from torch import nn from sglang.srt.layers.pooler import CrossEncodingPooler, Pooler, PoolingType from sglang.srt.layers.quantization.base_config import QuantizationConfig from sglang.srt.layers.sparse_pooler i...
339
11,907
sglang
python/sglang/srt/models/hunyuan_v3_nextn.py
.py
# coding=utf-8 # Copyright 2026 The HunYuan team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
259
8,987
sglang
python/sglang/srt/models/nano_nemotron_vl.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
392
15,912
sglang
python/sglang/srt/models/moss_vl.py
.py
"""PyTorch Moss-VL model for SGLang - Qwen3VL Vision + Text with Cross Attention.""" from __future__ import annotations import logging from array import array from functools import partial from typing import Iterable, List, Optional, Tuple import torch import torch.nn as nn from einops import rearrange from transfor...
1,737
65,136
sglang
python/sglang/srt/models/internlm2.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #...
361
13,222
sglang
python/sglang/srt/models/olmoe.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
440
16,156
sglang
python/sglang/srt/models/minicpm.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
400
14,538
sglang
python/sglang/srt/models/interns1.py
.py
from typing import Iterable, List, Optional, Tuple import torch from torch import nn from transformers import PretrainedConfig from sglang.srt.layers.attention import vision_utils from sglang.srt.layers.moe.fused_moe_triton.layer import FusedMoE from sglang.srt.layers.quantization.base_config import QuantizationConfi...
275
11,705
sglang
python/sglang/srt/models/deepseek_v4.py
.py
from __future__ import annotations import concurrent.futures import functools import logging import time from contextlib import contextmanager, nullcontext from typing import ( TYPE_CHECKING, Any, Callable, Iterable, List, NamedTuple, Optional, Set, Tuple, Union, ) import torch...
3,396
134,223
sglang
python/sglang/srt/models/llada2.py
.py
# coding=utf-8 # Copyright 2023 Antgroup and The HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # and OPT implementations in this library. It has been modified from its # original forms to accommodate minor architectural differences compared # to GPT...
985
36,227
sglang
python/sglang/srt/models/granitemoehybrid.py
.py
from typing import Iterable, Optional import torch from torch import nn from transformers.models.granitemoeshared import GraniteMoeSharedConfig from sglang.srt.configs.granitemoehybrid import GraniteMoeHybridConfig from sglang.srt.distributed import get_pp_group from sglang.srt.layers.activation import SiluAndMul fro...
741
26,385
sglang
python/sglang/srt/models/bailing_moe_linear.py
.py
# coding=utf-8 # Copyright 2023 Antgroup and The HuggingFace Inc. team. All rights reserved. import copy import logging from typing import Callable, Iterable, Optional, Set, Tuple, Union import torch import torch.nn.functional as F from torch import nn from transformers import PretrainedConfig from sglang.kernels.ops...
1,603
60,499
sglang
python/sglang/srt/models/iquest_loopcoder.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
499
18,435
sglang
python/sglang/srt/models/nemotron_nas.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
439
16,057
sglang
python/sglang/srt/models/mindspore.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the SGLang project from __future__ import annotations import logging from typing import Any, Iterable, List, Optional, Tuple import torch from sglang.srt.layers.logits_processor import LogitsProcessorOutput from sglang.srt.laye...
364
13,079
sglang
python/sglang/srt/models/lfm2_moe.py
.py
""" LFM2-MoE (Liquid Foundation Model 2 - Mixture of Experts) implementation for SGLang. This is a hybrid architecture with attention, ShortConv, and MoE layers: - Attention layers use standard KV cache (RadixAttention) - Conv layers use MambaPool for state caching (via HybridReqToTokenPool) - First `num_dense_layers`...
743
27,685
sglang
python/sglang/srt/models/deepseek.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
525
18,676
sglang
python/sglang/srt/models/falcon_h1.py
.py
import logging from typing import Any, Iterable, List, Optional, Set, Tuple import torch from torch import nn from sglang.srt.configs.falcon_h1 import FalconH1Config from sglang.srt.distributed import get_pp_group from sglang.srt.layers.activation import SiluAndMul from sglang.srt.layers.attention.hybrid_linear_attn_...
568
20,761
sglang
python/sglang/srt/models/muse_glimmer.py
.py
# Copyright 2023-2026 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
1,028
36,801
sglang
python/sglang/srt/models/longcat_flash.py
.py
# Apache License, Version 2.0: # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,171
47,682
sglang
python/sglang/srt/models/bailing_moe.py
.py
# coding=utf-8 # Copyright 2023 Antgroup and The HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # and OPT implementations in this library. It has been modified from its # original forms to accommodate minor architectural differences compared # to GPT...
1,042
38,205
sglang
python/sglang/srt/models/kimi_vl.py
.py
# SPDX-License-Identifier: Apache-2.0 # ruff: noqa: E501 # Adapted from https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct/blob/main/modeling_kimi_vl.py # Copyright 2025 The Moonshot AI Team, DeepSeek-AI, and HuggingFace Inc. team. All rights reserved. # # The code is based on llava (llava/modeling_llava.py) and De...
366
14,804
sglang
python/sglang/srt/models/lfm2.py
.py
""" LFM2 (Liquid Foundation Model 2) implementation for SGLang. This is a hybrid architecture with both attention and short conv layers. - Attention layers use standard KV cache (RadixAttention) - Conv layers use MambaPool for state caching (via HybridReqToTokenPool) The model uses a gated 1D causal convolution (kern...
701
24,618
sglang
python/sglang/srt/models/parakeet.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2026 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
185
7,337
sglang
python/sglang/srt/models/transformers.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Copyright 2025 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
1,639
61,642
sglang
python/sglang/srt/models/exaone.py
.py
# Copyright 2024 The LGcns AI Engineering Team # Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
378
13,546