Instructions to use LesterCerioli/LLM-GO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LesterCerioli/LLM-GO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LesterCerioli/LLM-GO")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LesterCerioli/LLM-GO", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LesterCerioli/LLM-GO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LesterCerioli/LLM-GO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LesterCerioli/LLM-GO", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LesterCerioli/LLM-GO
- SGLang
How to use LesterCerioli/LLM-GO 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 "LesterCerioli/LLM-GO" \ --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": "LesterCerioli/LLM-GO", "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 "LesterCerioli/LLM-GO" \ --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": "LesterCerioli/LLM-GO", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LesterCerioli/LLM-GO with Docker Model Runner:
docker model run hf.co/LesterCerioli/LLM-GO
| import pytest | |
| from llm_go.tokenizer.go_tokenizer import GoTokenizer | |
| SAMPLE_GO = """\ | |
| package main | |
| import "fmt" | |
| func main() { | |
| \tfmt.Println("Hello, Go!") | |
| } | |
| """ | |
| class TestGoTokenizerTraining: | |
| def test_train_encode_decode_roundtrip(self, tmp_path): | |
| texts = [SAMPLE_GO] * 50 # need enough data to train BPE merges | |
| tok = GoTokenizer.train( | |
| iterator=iter(texts), | |
| vocab_size=512, | |
| save_dir=str(tmp_path / "tok"), | |
| ) | |
| ids = tok.encode(SAMPLE_GO) | |
| assert len(ids) > 0 | |
| # Vocab check | |
| assert tok.vocab_size <= 512 | |
| def test_save_load(self, tmp_path): | |
| texts = [SAMPLE_GO] * 50 | |
| tok = GoTokenizer.train(iterator=iter(texts), vocab_size=512) | |
| tok.save(str(tmp_path / "tok")) | |
| tok2 = GoTokenizer.load(str(tmp_path / "tok")) | |
| assert tok.encode(SAMPLE_GO) == tok2.encode(SAMPLE_GO) | |
| def test_special_tokens_present(self, tmp_path): | |
| texts = [SAMPLE_GO] * 50 | |
| tok = GoTokenizer.train(iterator=iter(texts), vocab_size=512) | |
| assert tok.token_to_id("<pad>") == GoTokenizer.PAD_ID | |
| assert tok.token_to_id("<bos>") == GoTokenizer.BOS_ID | |
| assert tok.token_to_id("<eos>") == GoTokenizer.EOS_ID | |
| def test_encode_go_file_injects_tags(self, tmp_path): | |
| texts = [SAMPLE_GO] * 50 | |
| tok = GoTokenizer.train(iterator=iter(texts), vocab_size=512) | |
| ids = tok.encode_go_file(SAMPLE_GO, version="1.22") | |
| decoded = tok.decode(ids, skip_special_tokens=False) | |
| assert "<go_file>" in decoded | |
| assert "go1.22" in decoded | |
| def test_batch_encode(self, tmp_path): | |
| texts = [SAMPLE_GO] * 50 | |
| tok = GoTokenizer.train(iterator=iter(texts), vocab_size=512) | |
| batch = tok.encode_batch([SAMPLE_GO, SAMPLE_GO]) | |
| assert len(batch) == 2 | |
| assert batch[0] == batch[1] # identical inputs → identical outputs | |