Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llama-tokens

Babashka scripts for experimenting with ::M completions. Intended to be used with llama-server from llama.cpp.

Dependencies

  • babashka (bb command)
  • golang (go command)
  • llama-server from llama.cpp

Setup

Go to Hugging Face and find a gguf model you have enough "compute" to run, and run it something like this:

./build/bin/llama-server -m ~/models/Qwen3-14B-UD-Q5_K_XL.gguf -c 28000 --port 8080 --host 127.0.0.1

Copy the example config and point it at your server:

cp resources/config.edn.example resources/config.edn

Scripts

generate_chat

Uses the qwen3 chat template to produce an example

go run go/generate_chat.go

tokenize.bb

Tokenizes a string and prints the token IDs.

./tokenize.bb "Hello, world!"
# tokens: [9906 11 1917 0]

complete.bb

Runs a completion against the server.

./complete.bb "Once upon a time"

Options:

Flag Description
-n N / --max-tokens N Maximum tokens to generate (default: 30)
-c / --char-tokens Tokenize the prompt character-by-character before sending
-h / --help Show help

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages