Instructions to use KoalaAI/Bamboo-Nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KoalaAI/Bamboo-Nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KoalaAI/Bamboo-Nano")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KoalaAI/Bamboo-Nano") model = AutoModelForCausalLM.from_pretrained("KoalaAI/Bamboo-Nano") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KoalaAI/Bamboo-Nano with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KoalaAI/Bamboo-Nano" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KoalaAI/Bamboo-Nano", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KoalaAI/Bamboo-Nano
- SGLang
How to use KoalaAI/Bamboo-Nano 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 "KoalaAI/Bamboo-Nano" \ --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": "KoalaAI/Bamboo-Nano", "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 "KoalaAI/Bamboo-Nano" \ --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": "KoalaAI/Bamboo-Nano", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KoalaAI/Bamboo-Nano with Docker Model Runner:
docker model run hf.co/KoalaAI/Bamboo-Nano
Running in ollama
Hi, I'm trying to get this model to run in Ollama. It seems that it is the only model out there that is training on public domain code.
I try putting it in llama.cpp's convert_hf_to_gguf.py and I get "NotImplementedError: BPE pre-tokenizer was not recognized - update get_vocab_base_pre()". The BPE pre-tokenizer "48b3395982eda712c0f3aaa4056c791b9a2db4ee474467631e77bb46dab2b235" is also not recognized.
Would it be possible to ship the model in gguf format?
Hey there,
I have no idea how Ollama works (I assume it is just llama.cpp in a wrapper, since you talk about GGUF files), but in general this model is more of a "proof of concept", and as such is very limited as to what it can do, I have plans to make a proper, larger model also trained on CC0 data, but I have yet to get around to it.
I'll make sure to let you know when I do! :) (and to supply gguf files)