Text Generation
Transformers
Safetensors
English
Arabic
quasar_long
silx-ai
quasar-preview
quasar
foundation-model
Mixture of Experts
18b
2b-active
long-context
bittensor
sn24
decentralized-training
distillation
hybrid-transformer
loop-transformer
safe-nope
drope
conversational
custom_code
Instructions to use mainline777/base_IIXIV with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mainline777/base_IIXIV with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mainline777/base_IIXIV", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mainline777/base_IIXIV", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mainline777/base_IIXIV with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mainline777/base_IIXIV" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mainline777/base_IIXIV", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mainline777/base_IIXIV
- SGLang
How to use mainline777/base_IIXIV with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mainline777/base_IIXIV" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mainline777/base_IIXIV", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mainline777/base_IIXIV" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mainline777/base_IIXIV", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mainline777/base_IIXIV with Docker Model Runner:
docker model run hf.co/mainline777/base_IIXIV
| # Copyright (c) 2023-2025, Songlin Yang, Yu Zhang | |
| import torch | |
| import torch.nn.functional as F | |
| import triton | |
| import triton.language as tl | |
| from fla.utils import autotune_cache_kwargs, tensor_cache | |
| def prepare_position_ids_kernel( | |
| y, | |
| cu_seqlens, | |
| B: tl.constexpr, | |
| ): | |
| i_n = tl.program_id(0) | |
| bos, eos = tl.load(cu_seqlens + i_n).to(tl.int32), tl.load(cu_seqlens + i_n + 1).to(tl.int32) | |
| T = eos - bos | |
| o = tl.arange(0, B) | |
| for i in range(0, tl.cdiv(T, B) * B, B): | |
| o_i = o + i | |
| tl.store(y + bos + o_i, o_i, o_i < T) | |
| def prepare_lens(cu_seqlens: torch.LongTensor) -> torch.LongTensor: | |
| return torch.diff(cu_seqlens) | |
| def prepare_lens_from_mask(mask: torch.BoolTensor) -> torch.LongTensor: | |
| return mask.sum(dim=-1, dtype=torch.int32) | |
| def prepare_cu_seqlens_from_lens( | |
| lens: torch.LongTensor, | |
| dtype: torch.dtype | None = torch.int32, | |
| ) -> torch.LongTensor: | |
| return F.pad(lens.cumsum(dim=0, dtype=dtype), (1, 0)) | |
| def prepare_cu_seqlens_from_mask( | |
| mask: torch.BoolTensor, | |
| dtype: torch.dtype | None = torch.int32, | |
| ) -> torch.LongTensor: | |
| return prepare_cu_seqlens_from_lens(prepare_lens_from_mask(mask), dtype) | |
| def prepare_split_cu_seqlens( | |
| batch_size: int, | |
| seq_len: int, | |
| split_size: int, | |
| cu_seqlens: torch.LongTensor | None = None, | |
| dtype: torch.dtype | None = torch.int32, | |
| device: torch.device | None = torch.device('cpu'), | |
| ) -> torch.LongTensor: | |
| if cu_seqlens is None: | |
| total_tokens = batch_size * seq_len | |
| cu_seqlens = list(range(0, total_tokens, seq_len)) + [total_tokens] | |
| else: | |
| cu_seqlens = cu_seqlens.tolist() | |
| return torch.tensor( | |
| [ | |
| i | |
| for bos, eos in zip(cu_seqlens[:-1], cu_seqlens[1:], strict=False) | |
| for i in range(bos, eos, split_size) | |
| ] + [cu_seqlens[-1]], | |
| dtype=dtype, | |
| device=device, | |
| ) | |
| def prepare_position_ids(cu_seqlens: torch.LongTensor, cu_seqlens_cpu: torch.LongTensor | None = None) -> torch.LongTensor: | |
| if cu_seqlens_cpu is not None: | |
| return torch.cat([ | |
| torch.arange(n, dtype=cu_seqlens.dtype, device=cu_seqlens.device) | |
| for n in prepare_lens(cu_seqlens_cpu).unbind() | |
| ]) | |
| return torch.cat([ | |
| torch.arange(n, dtype=cu_seqlens.dtype, device=cu_seqlens.device) | |
| for n in prepare_lens(cu_seqlens).unbind() | |
| ]) | |
| def prepare_sequence_ids(cu_seqlens: torch.LongTensor, cu_seqlens_cpu: torch.LongTensor | None = None) -> torch.LongTensor: | |
| return prepare_position_ids(cu_seqlens, cu_seqlens_cpu).eq(0).cumsum(0) - 1 | |
| def prepare_token_indices(cu_seqlens: torch.LongTensor, cu_seqlens_cpu: torch.LongTensor | None = None) -> torch.LongTensor: | |
| position_ids = prepare_position_ids(cu_seqlens, cu_seqlens_cpu) | |
| return torch.stack([prepare_sequence_ids(cu_seqlens, cu_seqlens_cpu), position_ids], 1).to(cu_seqlens) | |
| def prepare_chunk_indices( | |
| cu_seqlens: torch.LongTensor, | |
| chunk_size: int, | |
| cu_seqlens_cpu: torch.LongTensor | None = None, | |
| ) -> torch.LongTensor: | |
| if cu_seqlens_cpu is not None: | |
| indices = torch.cat([torch.arange(n, device=cu_seqlens.device) | |
| for n in triton.cdiv(prepare_lens(cu_seqlens_cpu), chunk_size).tolist()]) | |
| return torch.stack([indices.eq(0).cumsum(0) - 1, indices], 1).to(cu_seqlens) | |
| indices = torch.cat([torch.arange(n) for n in triton.cdiv(prepare_lens(cu_seqlens), chunk_size).tolist()]) | |
| return torch.stack([indices.eq(0).cumsum(0) - 1, indices], 1).to(cu_seqlens) | |
| def prepare_chunk_offsets( | |
| cu_seqlens: torch.LongTensor, | |
| chunk_size: int, | |
| ) -> torch.LongTensor: | |
| return F.pad(triton.cdiv(prepare_lens(cu_seqlens), chunk_size), (1, 0), value=0).cumsum(-1) | |
| def get_max_num_splits( | |
| cu_seqlens: torch.LongTensor, | |
| chunk_size: int, | |
| cu_seqlens_cpu: torch.LongTensor | None = None | |
| ) -> int: | |
| if cu_seqlens_cpu is not None: | |
| return triton.cdiv(int(max(prepare_lens(cu_seqlens_cpu))), chunk_size) | |
| return triton.cdiv(int(max(prepare_lens(cu_seqlens))), chunk_size) | |