Text Generation
Transformers
PyTorch
code
mpt
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use replit/replit-code-v1-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use replit/replit-code-v1-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="replit/replit-code-v1-3b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("replit/replit-code-v1-3b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("replit/replit-code-v1-3b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use replit/replit-code-v1-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "replit/replit-code-v1-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "replit/replit-code-v1-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/replit/replit-code-v1-3b
- SGLang
How to use replit/replit-code-v1-3b 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 "replit/replit-code-v1-3b" \ --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": "replit/replit-code-v1-3b", "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 "replit/replit-code-v1-3b" \ --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": "replit/replit-code-v1-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use replit/replit-code-v1-3b with Docker Model Runner:
docker model run hf.co/replit/replit-code-v1-3b
Commit History
-
Update weights to MPT
Madhav5e4c25d -
Delete replit_lm.py
0ef6093 -
Delete low_precision_layernorm.py
1c6453a -
Delete gpt_blocks.py
3f27e64 -
Delete configuration_replit_lm.py
b634e3d -
Convert ReplitLM to MPT (#16)
- Convert ReplitLM to MPT (2635241d5b35bf63b8652513c212f645b78b1572) Co-authored-by: Madhav <madhavatreplit@users.noreply.huggingface.co>e023a84
-
Update README.md
9eceafb -
Update README.md (#5)
- Update README.md (2c290064b0dc519eee5624dfd3625b729ac5aea2)749980f -
Update README.md
266de40 -
Update README.md
01d2cf4 -
Update README.md
9e45a75 -
Update README.md
8090ce5 -
Update README.md
5d6823a -
Update README.md
bcf8dff -
Update README.md
4abee59
-
Update README.md
dcf1e76 -
Update README.md
4e7312f -
Update README.md
2c7d17d -
Update generation_config.json (#3)
- Update generation_config.json (4606bfa45afc6472ea3ad42663ab9f15968a50ee) Co-authored-by: Madhav <madhavatreplit@users.noreply.huggingface.co>4f57395 -
Update config.json (#2)
- Update config.json (e878244561b0c0c62c81aa847a9bd874460a8263) Co-authored-by: Madhav <madhavatreplit@users.noreply.huggingface.co>265df66 -
Add files for release (#1)
- Add files for release (9ed598fad7885d062e25157bbd3f549afd0964cc) Co-authored-by: Madhav <madhavatreplit@users.noreply.huggingface.co>ce1f658
-
initial commit
Madhav1076fcf