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/hunyuan_v3.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... | 651 | 23,889 |
sglang | python/sglang/srt/models/inkling.py | .py | from __future__ import annotations
import copy
import logging
import re
from typing import Iterable, Optional, Set, Tuple
import torch
from torch import nn
from sglang.srt.configs.inkling import (
InklingAudioConfig,
InklingMMConfig,
InklingModelConfig,
InklingVisionConfig,
)
from sglang.srt.distribu... | 2,031 | 88,853 |
sglang | python/sglang/srt/models/dots_vlm_vit.py | .py | import logging
from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint
from torch.nn import LayerNorm
from transformers.modeling_utils import PreTrainedModel
from sglang.srt.configs.dots_vlm import DotsVisionConfig
from sglang.srt.layers.attention.v... | 350 | 12,315 |
sglang | python/sglang/srt/models/qwen3_vl.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 ... | 1,604 | 61,539 |
sglang | python/sglang/srt/models/mimo_v2.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,662 | 63,130 |
sglang | python/sglang/srt/models/gemma4_causal.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... | 1,420 | 56,718 |
sglang | python/sglang/srt/models/bert.py | .py | # SPDX-License-Identifier: Apache-2.0
from typing import Iterable, Optional, Set, Tuple
import torch
from torch import nn
from sglang.srt.layers.activation import get_act_fn
from sglang.srt.layers.linear import (
ColumnParallelLinear,
QKVParallelLinear,
RowParallelLinear,
)
from sglang.srt.layers.pooler i... | 500 | 15,851 |
sglang | python/sglang/srt/models/qwen3_rm.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... | 48 | 1,713 |
sglang | python/sglang/srt/models/deepseek_v4_dspark.py | .py | from __future__ import annotations
import logging
from typing import Iterable, List, Optional, Tuple
import msgspec
import torch
import torch.nn.functional as F
from torch import nn
from sglang.kernels.ops.attention.dsv4 import fused_q_norm_rope, fused_rope_inplace
from sglang.kernels.ops.attention.dsv4.unified_kv_k... | 934 | 34,412 |
sglang | python/sglang/srt/models/qwen3_moe.py | .py | # Adapted from qwen2_moe.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 applicab... | 1,253 | 46,334 |
sglang | python/sglang/srt/models/qwen2_audio.py | .py | # coding=utf-8
# Adapted from
# https://github.com/huggingface/transformers/blob/1d45d90e5d1552eccb6d8cc9b7bba283ccefb808/src/transformers/models/qwen2_audio/modeling_qwen2_audio.py
# Copyright 2024 The Qwen team.
# Copyright 2023 The vLLM team.
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights rese... | 190 | 7,098 |
sglang | python/sglang/srt/models/minicpm3.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... | 520 | 19,317 |
sglang | python/sglang/srt/models/hunyuan.py | .py | # coding=utf-8
# Copyright 2024 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... | 809 | 30,661 |
sglang | python/sglang/srt/models/gemma.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
#
#... | 414 | 14,271 |
sglang | python/sglang/srt/models/mllama.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/7193774b1ff8603ad5bf4598e5efba0d9a39b436/vllm/model_executor/models/mllama.py
"""PyTorch Mllama model."""
from __future__ import annotations
import mat... | 1,085 | 40,742 |
sglang | python/sglang/srt/models/ernie45_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... | 879 | 32,019 |
sglang | python/sglang/srt/models/lightonocr.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... | 300 | 12,837 |
sglang | python/sglang/srt/models/minicpmo.py | .py | # Copied and adapted from: https://huggingface.co/openbmb/MiniCPM-o-2_6/blob/main/modeling_minicpmo.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
#
# ... | 1,950 | 77,910 |
sglang | python/sglang/srt/models/deepseek_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... | 418 | 16,182 |
sglang | python/sglang/srt/models/llama_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... | 90 | 3,146 |
sglang | python/sglang/srt/models/solar.py | .py | # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from collections.abc import Iterable
from typing import Any, List, Optional, Tuple, Union
import torch
from torch import nn
from transformers import PretrainedConfig
from sglang.srt.distributed import get_pp_gr... | 507 | 18,246 |
sglang | python/sglang/srt/models/qwen.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
#
# ... | 358 | 11,934 |
sglang | python/sglang/srt/models/radio.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... | 613 | 20,025 |
sglang | python/sglang/srt/models/baichuan.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/baichuan.py
# coding=utf-8
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
#
# This code is... | 454 | 16,160 |
sglang | python/sglang/srt/models/glm4_moe.py | .py | # Copyright 2025-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,520 | 58,449 |
sglang | python/sglang/srt/models/jet_nemotron.py | .py | from collections.abc import Iterable
from typing import cast
import einops
import torch
import torch.nn as nn
from sglang.kernels.ops.attention.fla.fused_recurrent import (
fused_recurrent_gated_delta_rule_update,
)
from sglang.kernels.ops.attention.fla.layernorm_gated import RMSNorm as RMSNormGated
from sglang.s... | 599 | 19,378 |
sglang | python/sglang/srt/models/midashenglm.py | .py | import collections
import collections.abc
import logging
from collections.abc import Callable, Sequence
from typing import Iterable, List, Optional, Tuple, TypeAlias, cast
import torch
import torch.nn as nn
import torchaudio.functional as F
from transformers import PretrainedConfig
from sglang.srt.layers.attention.vi... | 700 | 25,841 |
sglang | python/sglang/srt/models/kimi_k3_vl.py | .py | """Kimi K3 vision tower (MoonViT3d) and projector.
Faithful port of the checkpoint reference implementation
(modeling_kimi_k3.py). Dedicated to K3 — do not share with Kimi K2.5:
K3 uses qkv_hidden_size != hidden_size (head_dim = qkv_hidden_size //
num_heads), RMSNorm encoder norms, bias-free linears, and the
PatchMerg... | 938 | 32,790 |
sglang | python/sglang/srt/models/cohere2_moe.py | .py | # SPDX-License-Identifier: Apache-2.0
# Copyright 2026 SGLang Team
# Adapted from:
# https://github.com/vllm-project/vllm/blob/v0.21.0/vllm/model_executor/models/cohere2_moe.py
"""Inference-only Cohere2Moe (Command A Plus) model compatible with HuggingFace weights."""
from typing import Iterable, Optional, Tuple
impo... | 619 | 23,133 |
sglang | python/sglang/srt/models/llama_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... | 147 | 5,203 |
sglang | python/sglang/srt/models/mllama4.py | .py | import json as json_lib
import logging
import math
import os
import re
from collections.abc import Iterable
from typing import List, Optional, Set, Tuple
import torch
from torch import nn
from transformers import Llama4Config, Llama4VisionConfig
from transformers.models.llama4.modeling_llama4 import (
Llama4MultiM... | 1,039 | 37,817 |
sglang | python/sglang/srt/models/dots_ocr.py | .py | # coding=utf-8
# Adapted from Qwen2.5-VL SGLang implementation
import logging
from typing import Iterable, List, Optional, Tuple
import torch
import torch.nn as nn
from sglang.srt.configs import DotsOCRConfig
from sglang.srt.layers.logits_processor import LogitsProcessor
from sglang.srt.layers.quantization.base_conf... | 172 | 6,683 |
sglang | python/sglang/srt/models/llama_embedding.py | .py | from typing import Iterable, Tuple
import torch
from torch import nn
from transformers import LlamaConfig
from sglang.srt.layers.pooler import EmbeddingPoolerOutput, Pooler, PoolingType
from sglang.srt.model_executor.model_runner import ForwardBatch
from sglang.srt.model_loader.weight_utils import default_weight_load... | 88 | 3,254 |
sglang | python/sglang/srt/models/utils.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... | 746 | 26,549 |
sglang | python/sglang/srt/models/qwen3_moe_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... | 132 | 4,913 |
sglang | python/sglang/srt/models/grok.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,000 | 35,783 |
sglang | python/sglang/srt/models/deepseek_janus_pro.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... | 2,064 | 70,348 |
sglang | python/sglang/srt/models/ministral3.py | .py | from typing import Any, Dict, Optional
import torch
from transformers import PretrainedConfig
from sglang.srt.layers.quantization.base_config import QuantizationConfig
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
from sglang.srt.models.llama import (
LlamaAttention,
LlamaDecoderLayer,... | 170 | 5,836 |
sglang | python/sglang/srt/models/granite.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
#
#... | 509 | 19,897 |
sglang | python/sglang/srt/models/mistral_eagle.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... | 209 | 8,776 |
sglang | python/sglang/srt/models/siglip.py | .py | # Adapted from
# https://github.com/huggingface/transformers/blob/af9b2eaa54c150741f298d6db939af6328e1dc38/src/transformers/models/siglip/modeling_siglip.py
from functools import partial
from typing import Optional, Type, Union
import torch
import torch.nn as nn
from transformers import SiglipVisionConfig
from sglan... | 283 | 9,354 |
sglang | python/sglang/srt/models/gpt_bigcode.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
#
#... | 308 | 10,379 |
sglang | python/sglang/srt/models/qwen3_5.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 ... | 2,367 | 93,036 |
sglang | python/sglang/srt/models/phimoe.py | .py | from typing import Iterable, Optional, Tuple, Union
import torch
from torch import nn
from transformers.configuration_utils import PretrainedConfig
from sglang.srt.layers.linear import (
QKVParallelLinear,
ReplicatedLinear,
RowParallelLinear,
)
from sglang.srt.layers.logits_processor import LogitsProcesso... | 559 | 19,059 |
sglang | python/sglang/srt/models/minimax_vl_common.py | .py | # SPDX-License-Identifier: Apache-2.0
import logging
from dataclasses import dataclass, fields
from typing import List, Optional, Tuple
import numpy as np
import torch
import torch.nn as nn
from sglang.srt.layers.activation import get_act_fn
from sglang.srt.layers.attention.vision import (
BATCH_BUCKETS,
FLA... | 902 | 32,125 |
sglang | python/sglang/srt/models/nemotron_h_mtp.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... | 378 | 13,077 |
sglang | python/sglang/srt/models/phi.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/phi.py
from typing import Iterable, Optional
import torch
from torch import nn
from transformers import PhiConfig
from sgl... | 325 | 10,383 |
sglang | python/sglang/srt/models/clip.py | .py | # Adapted from
# https://github.com/huggingface/transformers/blob/af9b2eaa54c150741f298d6db939af6328e1dc38/src/transformers/models/clip/modeling_clip.py
from functools import partial
from typing import Iterable, List, Optional, Tuple, Type, Union
import torch
import torch.nn as nn
from transformers import CLIPConfig,... | 561 | 19,307 |
sglang | python/sglang/srt/models/exaone_moe.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... | 876 | 31,607 |
sglang | python/sglang/srt/models/stablelm.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
#
#... | 351 | 12,965 |
sglang | python/sglang/srt/models/qwen3_embedding.py | .py | import logging
from typing import Iterable, Optional, Tuple
import torch
from torch import nn
from sglang.srt.layers.pooler import EmbeddingPoolerOutput, Pooler, PoolingType
from sglang.srt.layers.quantization.base_config import QuantizationConfig
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
... | 125 | 4,840 |
sglang | python/sglang/srt/models/glm4v.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... | 826 | 30,818 |
sglang | python/sglang/srt/models/laguna.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
"""Inference-only Laguna (poolside/Laguna-XS.2) model."""
f... | 877 | 32,820 |
sglang | python/sglang/srt/models/phi4mm_utils.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,918 | 66,956 |
sglang | python/sglang/srt/models/nvila_lite.py | .py | import math
from collections.abc import Iterable
from typing import Any
import einops
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from transformers.configuration_utils import PretrainedConfig
from transformers.modeling_outputs import BaseModelOutputWithPooling
from trans... | 189 | 6,425 |
sglang | python/sglang/srt/models/dots_vlm.py | .py | # Copyright 2025 The RedNote HiLab team.
# Copyright 2025 The SGLang team.
#
# This code is based on the DeepseekVL2ForCausalLM and DotsVisionTransformer
# implementation in this library.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 196 | 8,090 |
sglang | python/sglang/srt/models/olmo.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
#
#... | 383 | 12,784 |
sglang | python/sglang/srt/models/nemotron_h_utils.py | .py | """DP-attention helpers for the Nemotron-H model."""
import torch
from torch import nn
from sglang.srt.configs.nemotron_h import ATTENTION, MAMBA
from sglang.srt.distributed import tensor_model_parallel_all_reduce
from sglang.srt.layers.communicator import (
LayerCommunicator,
LayerScatterModes,
ScatterMo... | 107 | 3,692 |
sglang | python/sglang/srt/models/yivl.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... | 119 | 5,051 |
sglang | python/sglang/srt/models/lfm2_vl.py | .py | # 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 349 | 13,183 |
sglang | python/sglang/srt/models/afmoe.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... | 649 | 23,239 |
sglang | python/sglang/srt/models/deepseek_v4_nextn.py | .py | import logging
from typing import Iterable, Optional, Tuple
import torch
import torch.nn.functional as F
from torch import nn
from transformers import PretrainedConfig
from sglang.srt.distributed import get_pp_group
from sglang.srt.layers.attention.dsa.utils import (
can_dsa_cp_split,
dsa_use_prefill_cp,
... | 301 | 11,084 |
sglang | python/sglang/srt/models/points_v15_chat.py | .py | import copy
from typing import Iterable, List, Optional, Set, Tuple
import torch
import torch.nn.functional as F
from torch import nn
from sglang.srt.configs.points_v15_chat import POINTSV15ChatConfig
from sglang.srt.layers.quantization.base_config import QuantizationConfig
from sglang.srt.managers.mm_utils import (
... | 187 | 6,415 |
sglang | python/sglang/srt/models/gemma4_audio.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... | 871 | 31,556 |
sglang | python/sglang/srt/models/qwen3_asr.py | .py | """Qwen3-ASR model compatible with HuggingFace weights"""
import logging
from typing import Any, Iterable, List, Optional, Tuple
import torch
import torch.nn as nn
from sglang.srt.configs.qwen3_asr import Qwen3ASRConfig
from sglang.srt.configs.qwen3_omni import Qwen3OmniMoeAudioEncoderConfig
from sglang.srt.layers.q... | 200 | 7,139 |
sglang | python/sglang/srt/models/chatglm.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... | 428 | 13,921 |
sglang | python/sglang/srt/models/gemma4_mm.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... | 1,118 | 46,430 |
sglang | python/sglang/srt/models/pixtral.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,054 | 38,492 |
sglang | python/sglang/srt/models/glm_ocr_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... | 161 | 5,680 |
sglang | python/sglang/srt/models/glm4v_moe.py | .py | import logging
from functools import lru_cache
from typing import Iterable, Optional, Tuple
import torch
import torch.nn as nn
from transformers.models.glm4v_moe.configuration_glm4v_moe import Glm4vMoeConfig
from sglang.srt.distributed.parallel_state import get_pp_group
from sglang.srt.layers.attention import vision_... | 279 | 11,940 |
sglang | python/sglang/srt/models/nemotron_h.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
#
# ... | 1,270 | 47,711 |
sglang | python/sglang/srt/models/glm4_moe_lite.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... | 1,284 | 50,530 |
sglang | python/sglang/srt/models/mimo_audio.py | .py | """MiMo audio: tokenizer, encoding utilities, and audio encoder."""
# Audio tokenizer adapted from https://github.com/XiaomiMiMo/MiMo-Audio-Tokenizer.git
import logging
import math
import os
import typing as tp
from dataclasses import dataclass
from functools import wraps
from typing import Optional, Tuple
import to... | 1,389 | 52,202 |
sglang | python/sglang/srt/models/mistral_large_3.py | .py | # Adapted from https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/mistral_large_3.py
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from collections.abc import Iterable
import regex as re
import torch
from sglang.srt.models.deepseek_v2... | 80 | 4,847 |
sglang | python/sglang/srt/models/glm_ocr.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... | 449 | 16,430 |
sglang | python/sglang/srt/models/kimi_linear.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/0384aa7150c4c9778efca041ffd1beb3ad2bd694/vllm/model_executor/models/kimi_linear.py
from collections.abc import Iterable
from typing import Optional
impor... | 895 | 34,536 |
sglang | python/sglang/srt/models/jet_vlm.py | .py | import math
from collections.abc import Iterable
import einops
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from transformers.modeling_outputs import BaseModelOutputWithPooling
from transformers.models.siglip import SiglipVisionModel
import sglang.srt.managers.mm_utils a... | 144 | 4,705 |
sglang | python/sglang/srt/models/phi3_small.py | .py | import math
from typing import Iterable, Optional, Tuple, Union
import torch
from torch import nn
from transformers import Phi3Config
from transformers.configuration_utils import PretrainedConfig
from sglang.srt.distributed import get_pp_group
from sglang.srt.layers.linear import (
MergedColumnParallelLinear,
... | 481 | 16,063 |
sglang | python/sglang/srt/models/qwen2_5_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.
... | 912 | 34,266 |
sglang | python/sglang/srt/models/qwen2_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 writi... | 80 | 2,744 |
sglang | python/sglang/srt/models/step3p5_mtp.py | .py | import logging
from collections.abc import Iterable
from typing import Optional
import torch
import torch.nn as nn
from transformers import PretrainedConfig
from sglang.srt.layers.layernorm import GemmaRMSNorm
from sglang.srt.layers.logits_processor import LogitsProcessor
from sglang.srt.layers.quantization.base_conf... | 336 | 13,342 |
sglang | python/sglang/srt/models/nvila.py | .py | import itertools
import math
from collections.abc import Iterable
from typing import Any
import einops
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from transformers.configuration_utils import PretrainedConfig
from transformers.modeling_outputs import BaseModelOutputWithP... | 358 | 12,213 |
sglang | python/sglang/srt/models/mixtral.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
#
# ... | 481 | 17,098 |
sglang | python/sglang/srt/models/hrm_text.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... | 478 | 17,584 |
sglang | python/sglang/srt/models/dspark.py | .py | from __future__ import annotations
import logging
from typing import Callable, Iterable, Optional, Tuple
import torch
import torch.nn.functional as F
from torch import nn
from sglang.srt.distributed.communication_op import tensor_model_parallel_all_gather
from sglang.srt.environ import envs
from sglang.srt.model_loa... | 731 | 27,513 |
sglang | python/sglang/srt/models/gemma4_unified.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... | 439 | 19,217 |
sglang | python/sglang/srt/models/sdar.py | .py | # coding=utf-8
"""
SGLang SDARModelLM (block diffusion / dLLM-style forward).
"""
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
from sglang.srt.layers.activation import Sil... | 587 | 20,324 |
sglang | python/sglang/srt/models/llama_eagle.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... | 150 | 5,067 |
sglang | python/sglang/srt/models/internvl.py | .py | # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from typing import Iterable, List, Optional, Tuple, Union
import torch
# Adapted from https://raw.githubusercontent.com/vllm-project/vllm/7f62077af5159c625fe3ad1c812e6c1a2b93ba3b/vllm/model_executor/models/inter... | 813 | 31,500 |
sglang | python/sglang/srt/models/qwen3.py | .py | # Adapted from qwen2.py
import logging
from typing import Any, Dict, Iterable, List, Optional, Tuple
import torch
from torch import nn
from sglang.srt.distributed import (
get_pp_group,
)
from sglang.srt.layers.communicator import LayerCommunicator, LayerScatterModes
from sglang.srt.layers.layernorm import RMSNor... | 719 | 25,837 |
sglang | python/sglang/srt/models/registry.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/v0.6.4.post1/vllm/model_executor/models/registry.py
import importlib
import logging
import pkgutil
from dataclasses import dataclass, field
from functools ... | 135 | 4,857 |
sglang | python/sglang/srt/models/locate_anything.py | .py | # SPDX-License-Identifier: Apache-2.0
# Adapted from https://huggingface.co/nvidia/LocateAnything-3B/blob/main/modeling_locateanything.py
# and from vllm-project/vllm PR #44182.
"""Inference-only LocateAnything-3B model for SGLang.
LocateAnything-3B is a multimodal grounding/detection model:
* MoonViT vision encode... | 404 | 17,097 |
sglang | python/sglang/srt/models/cohere2_vision.py | .py | # SPDX-License-Identifier: Apache-2.0
# Copyright 2026 SGLang Team
# Adapted from:
# https://github.com/vllm-project/vllm/blob/v0.21.0/vllm/model_executor/models/cohere2_vision.py
"""Inference-only Cohere2Vision (Command-A-Vision) multimodal model."""
import math
from typing import Iterable, List, Optional, Tuple
imp... | 264 | 11,270 |
sglang | python/sglang/srt/models/gemma3n_audio.py | .py | import math
from typing import Optional, Sequence, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import Gemma3nAudioConfig, PreTrainedModel
from sglang.srt.layers.linear import (
ColumnParallelLinear,
QKVParallelLinear,
RowParallelLinear,
)
from sglang.srt.laye... | 950 | 36,405 |
sglang | python/sglang/srt/models/unlimited_ocr.py | .py | """Standalone UNLIMITED-OCR model (SAM + CLIP vision encoders, Deepseek backbone)."""
import logging
from typing import Iterable, List, Optional, Set, Tuple, TypeAlias, Union
import torch
from torch import Tensor, nn
from sglang.srt.configs.unlimited_ocr import UnlimitedVLConfig
from sglang.srt.layers.quantization i... | 439 | 17,108 |
sglang | python/sglang/srt/models/deepseek_v2.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
#
# ... | 3,253 | 133,350 |
sglang | python/sglang/srt/models/starcoder2.py | .py | # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# Copyright 2024 BigCode 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 modifie... | 360 | 12,394 |
sglang | python/sglang/srt/models/llava.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... | 895 | 39,985 |
sglang | python/sglang/srt/models/phi4mm.py | .py | # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# 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
#
# h... | 541 | 20,694 |
sglang | python/sglang/srt/models/llama4.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
#
# ... | 586 | 21,091 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.