Instructions to use YifeiZuo/Parallax-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YifeiZuo/Parallax-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="YifeiZuo/Parallax-1.7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("YifeiZuo/Parallax-1.7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use YifeiZuo/Parallax-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YifeiZuo/Parallax-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YifeiZuo/Parallax-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/YifeiZuo/Parallax-1.7B
- SGLang
How to use YifeiZuo/Parallax-1.7B 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 "YifeiZuo/Parallax-1.7B" \ --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": "YifeiZuo/Parallax-1.7B", "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 "YifeiZuo/Parallax-1.7B" \ --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": "YifeiZuo/Parallax-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use YifeiZuo/Parallax-1.7B with Docker Model Runner:
docker model run hf.co/YifeiZuo/Parallax-1.7B
Download configuration_parallax.py from YifeiZuo/Parallax-1.7B: direct link, hf CLI and curl.
- Browser
- Download file 1.79 kB
-
https://huggingface.co/YifeiZuo/Parallax-1.7B/resolve/main/configuration_parallax.py
- Command line
-
hf download hf://YifeiZuo/Parallax-1.7B/configuration_parallax.py
-
curl -L -o configuration_parallax.py https://huggingface.co/YifeiZuo/Parallax-1.7B/resolve/main/configuration_parallax.py
1.79 kB
| """Parallax HF config (inherits Qwen3Config). | |
| Parallax (Parameterized Local Linear Attention) reuses the Qwen3 architecture | |
| and swaps softmax self-attention for the parallax op. This config inherits from | |
| ``transformers.models.qwen3.configuration_qwen3.Qwen3Config`` so it picks up all | |
| of Qwen3's conventions for free (strict dataclass, ``rope_parameters``, | |
| ``layer_types``, tp/pp plans, etc.). | |
| The only Parallax-specific addition is the ``attn_type`` field, which selects the | |
| attention implementation. When ``attn_type == "sdpa"`` this config describes a | |
| plain Qwen3-equivalent model. | |
| Reference: https://arxiv.org/abs/2605.29157 | |
| """ | |
| from __future__ import annotations | |
| from transformers.models.qwen3.configuration_qwen3 import Qwen3Config | |
| class ParallaxConfig(Qwen3Config): | |
| r"""Config for the Parallax model (Qwen3-derived). | |
| Args: | |
| attn_type (`str`, *optional*, defaults to `"parallax"`): | |
| Attention implementation. Must be one of ``"sdpa"`` or | |
| ``"parallax"``. ``"sdpa"`` uses the plain Qwen3 causal attention | |
| path (softmax attention). ``"parallax"`` uses the parallax op and | |
| requires the extra ``r_proj`` / ``r_norm`` per-layer weights. | |
| """ | |
| model_type = "parallax" | |
| # ---- Parallax-specific extra ---- | |
| # "sdpa" : plain causal self-attention (identical to Qwen3). | |
| # "parallax": the parallax op (adds r_proj + r_norm and replaces softmax | |
| # self-attention). | |
| attn_type: str = "parallax" | |
| def __post_init__(self, **kwargs): | |
| if self.attn_type not in ("sdpa", "parallax"): | |
| raise ValueError( | |
| f"attn_type must be 'sdpa' or 'parallax', got {self.attn_type!r}" | |
| ) | |
| super().__post_init__(**kwargs) | |
| __all__ = ["ParallaxConfig"] | |