Text Generation
Transformers
PyTorch
English
experimental
research
bit-level
transformer
reversible
safety
telemetry
language-modeling
Instructions to use WCNegentropy/BitTransformerLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WCNegentropy/BitTransformerLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WCNegentropy/BitTransformerLM")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("WCNegentropy/BitTransformerLM", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use WCNegentropy/BitTransformerLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WCNegentropy/BitTransformerLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WCNegentropy/BitTransformerLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WCNegentropy/BitTransformerLM
- SGLang
How to use WCNegentropy/BitTransformerLM 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 "WCNegentropy/BitTransformerLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WCNegentropy/BitTransformerLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "WCNegentropy/BitTransformerLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WCNegentropy/BitTransformerLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WCNegentropy/BitTransformerLM with Docker Model Runner:
docker model run hf.co/WCNegentropy/BitTransformerLM
| #!/usr/bin/env python3 | |
| """ | |
| Sync BitTransformerLM repository to HuggingFace Hub for OS launch. | |
| Uploads all cleaned documentation and code with proper commit message. | |
| """ | |
| import os | |
| import logging | |
| from pathlib import Path | |
| from huggingface_hub import HfApi, login | |
| from typing import Optional, List | |
| # Setup logging | |
| logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') | |
| logger = logging.getLogger(__name__) | |
| def sync_repository_to_hf( | |
| repo_id: str = "WCNegentropy/BitTransformerLM", | |
| token: Optional[str] = None, | |
| commit_message: str = "๐ OS Launch: Clean documentation and refined licensing" | |
| ): | |
| """ | |
| Sync the entire cleaned BitTransformerLM repository to HuggingFace Hub. | |
| Args: | |
| repo_id: HuggingFace repository ID | |
| token: HF token (defaults to HF_TOKEN environment variable) | |
| commit_message: Commit message for the upload | |
| """ | |
| # Get token from environment if not provided | |
| if token is None: | |
| token = os.environ.get('HF_TOKEN') | |
| if not token: | |
| logger.error("HF_TOKEN environment variable not set and no token provided") | |
| return False | |
| try: | |
| # Login to HuggingFace | |
| login(token=token) | |
| api = HfApi() | |
| logger.info("Successfully authenticated with HuggingFace Hub") | |
| # Get the repository root directory | |
| repo_root = Path(__file__).parent | |
| logger.info(f"Repository root: {repo_root}") | |
| # Files and directories to upload (excluding unnecessary files) | |
| include_patterns = [ | |
| # Core code | |
| "bit_transformer/**/*.py", | |
| "tests/**/*.py", | |
| "*.py", # Root level Python files | |
| # Documentation (cleaned) | |
| "README.md", | |
| "MODEL_CARD.md", | |
| "RESEARCH_STATUS.md", | |
| "EMPIRICAL_VALIDATION.md", | |
| "OPEN_SOURCE_LAUNCH.md", | |
| "AGENTS.md", | |
| # Configuration | |
| "requirements.txt", | |
| "pyproject.toml", | |
| "Dockerfile", | |
| "start.sh", | |
| # License files (cleaned) | |
| "LICENSE/**/*.txt", | |
| ] | |
| # Files to exclude | |
| exclude_patterns = [ | |
| "__pycache__/**", | |
| "*.pyc", | |
| ".git/**", | |
| ".pytest_cache/**", | |
| "weights/**", | |
| "checkpoints/**", | |
| "*.log", | |
| # Outdated documentation | |
| "BitTransformerLM_full_assessment.md", | |
| "FORENSIC_*.md", | |
| "state_of_the_repo_audit.md", | |
| # Old upload script | |
| "upload_to_hf.py", | |
| ] | |
| # Get all files to upload | |
| files_to_upload = [] | |
| for pattern in include_patterns: | |
| for file_path in repo_root.glob(pattern): | |
| if file_path.is_file(): | |
| # Check if file should be excluded | |
| relative_path = file_path.relative_to(repo_root) | |
| should_exclude = any( | |
| relative_path.match(exclude) | |
| for exclude in exclude_patterns | |
| ) | |
| if not should_exclude: | |
| files_to_upload.append(file_path) | |
| logger.info(f"Found {len(files_to_upload)} files to upload") | |
| # Upload files in batches | |
| uploaded_count = 0 | |
| for file_path in files_to_upload: | |
| try: | |
| relative_path = file_path.relative_to(repo_root) | |
| logger.info(f"Uploading: {relative_path}") | |
| api.upload_file( | |
| path_or_fileobj=str(file_path), | |
| path_in_repo=str(relative_path), | |
| repo_id=repo_id, | |
| repo_type="model", | |
| commit_message=commit_message, | |
| commit_description=""" | |
| This OS launch commit includes: | |
| โ **Cleaned Documentation** | |
| - Removed inflated claims and marketing language | |
| - Added honest research status and limitations | |
| - Created professional model card and validation reports | |
| - Streamlined licensing to AGPLv3 + commercial contact | |
| โ **Refined Codebase** | |
| - Complete experimental bit-native transformer implementation | |
| - 57 Python files with comprehensive research framework | |
| - Safety telemetry and monitoring systems | |
| - Distributed training and development tools | |
| โ **Professional Standards** | |
| - Empirical validation of all claims | |
| - Clear experimental vs production distinctions | |
| - Rigorous research methodology requirements | |
| - Community contribution framework | |
| Ready for serious research evaluation and academic investigation. | |
| """.strip() | |
| ) | |
| uploaded_count += 1 | |
| if uploaded_count % 10 == 0: | |
| logger.info(f"Progress: {uploaded_count}/{len(files_to_upload)} files uploaded") | |
| except Exception as e: | |
| logger.warning(f"Failed to upload {relative_path}: {e}") | |
| continue | |
| logger.info(f"โ Successfully uploaded {uploaded_count}/{len(files_to_upload)} files") | |
| logger.info(f"๐ Repository synced to: https://huggingface.co/{repo_id}") | |
| return True | |
| except Exception as e: | |
| logger.error(f"โ Failed to sync repository: {e}") | |
| return False | |
| def create_release_info(): | |
| """Create a release information file for the OS launch.""" | |
| release_info = """# BitTransformerLM v0.1.0 - Experimental Research Release | |
| **Release Date:** August 2025 | |
| **Status:** Open Source Research Implementation | |
| **License:** AGPLv3 + Commercial Licensing Available | |
| ## What's Included | |
| This release provides a complete experimental framework for bit-native language modeling research: | |
| - **Core Architecture:** 57 Python files implementing bit-native transformer with reversible layers | |
| - **Safety Systems:** Real-time K/C/S telemetry and monitoring | |
| - **Research Tools:** Interactive dashboard, distributed training, comprehensive testing | |
| - **Documentation:** Professional model card, research status, and validation reports | |
| ## Important Notes | |
| โ ๏ธ **Experimental Status:** This is research code requiring rigorous baseline validation | |
| โ ๏ธ **Not Production Ready:** Needs extensive evaluation vs standard transformers | |
| โ ๏ธ **Research Use Only:** Intended for academic investigation and experimentation | |
| ## Licensing | |
| - **Open Source:** AGPLv3 for research and open source use | |
| - **Commercial:** Contact contact@wcnegentropy.com for commercial licensing | |
| ## Next Steps | |
| The research community is invited to: | |
| 1. Conduct rigorous baseline comparisons vs standard transformers | |
| 2. Evaluate on established language modeling benchmarks | |
| 3. Validate (or refute) claimed memory efficiency benefits | |
| 4. Share findings openly to advance the field | |
| **Research responsibly. Validate rigorously. Share openly.** | |
| """ | |
| release_file = Path(__file__).parent / "RELEASE_INFO.md" | |
| with open(release_file, 'w') as f: | |
| f.write(release_info) | |
| logger.info("Created RELEASE_INFO.md") | |
| return release_file | |
| if __name__ == "__main__": | |
| # Create release info file | |
| create_release_info() | |
| # Sync to HuggingFace | |
| success = sync_repository_to_hf() | |
| if success: | |
| print("\n๐ BitTransformerLM OS Launch Sync Complete!") | |
| print("๐ Repository: https://huggingface.co/WCNegentropy/BitTransformerLM") | |
| print("๐ง Commercial inquiries: contact@wcnegentropy.com") | |
| print("\nReady for research community evaluation! ๐งชโจ") | |
| else: | |
| print("\nโ Sync failed. Please check logs and try again.") |