{"library":"qwix","title":"Qwix: A JAX Quantization Library","description":"Qwix is a JAX-native quantization library for both research and production, providing efficient model compression through Quantization-Aware Training (QAT), Post-Training Quantization (PTQ), and ODML quantization. It supports various XLA targets (CPU/GPU/TPU) and LiteRT, featuring a flexible, regex-based configuration system for Flax Linen and NNX models. The current version is 0.1.5, with an active release cadence.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install git+https://github.com/google/qwix"],"cli":null},"imports":["import qwix","from qwix import QuantizationRule","from qwix import quantize_model"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import jax\nimport jax.numpy as jnp\nfrom flax import linen as nn\nimport qwix\n\n# Define a simple MLP model using Flax Linen\nclass MLP(nn.Module):\n    dhidden: int = 64\n    dout: int = 10\n\n    @nn.compact\n    def __call__(self, x):\n        x = nn.Dense(self.dhidden, use_bias=False)(x)\n        x = nn.relu(x)\n        x = nn.Dense(self.dout, use_bias=False)(x)\n        return x\n\n# Initialize the model and dummy input\nmodel = MLP()\nkey = jax.random.key(0)\nmodel_input = jax.random.uniform(key, (8, 16))\nparams = model.init(key, model_input)['params']\n\n# Define quantization rules for int8 weight and activation quantization\n# This rule matches all modules ('.*')\nrules = [\n    qwix.QuantizationRule(\n        module_path='.*',\n        weight_qtype=jnp.int8,\n        act_qtype=jnp.int8,\n    )\n]\n\n# Apply Post-Training Quantization (PTQ)\nptq_model = qwix.quantize_model(model, qwix.PtqProvider(rules))\n\nprint(\"Original model parameters (example kernel shape):\", params['Dense_0']['kernel'].shape)\nprint(\"Quantized model parameters (example kernel):\", jax.eval_shape(ptq_model.apply, {'params': params}, model_input)['Dense_0']['kernel'])","lang":"python","description":"This quickstart demonstrates how to define a simple Flax MLP model and then apply Post-Training Quantization (PTQ) using Qwix. It configures a `QuantizationRule` to quantize both weights and activations to int8 across all modules in the model, and then applies the quantization using `qwix.quantize_model`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"0.1.6","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"git+https://github.com/google/qwix","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}