from transformers import AutoModelForCausalLM, AutoTokenizer model = AutoModelForCausalLM.from_pretrained("distil-labs/distil-gemma3-270m-SHELLper")tokenizer = AutoTokenizer.from_pretrained("distil-labs/distil-gemma3-270m-SHELLper") tools = [ { "type": "function", "function": { "name": "ls", "description": "List directory contents", "parameters": { "type": "object", "properties": { "folder": {"type": "string", "description": "Path to the folder to list"} }, "required": ["folder"] } } }] messages = [ {"role": "system", "content": "You are a helpful assistant that executes bash commands."}, {"role": "user", "content": "List all files in the current directory"}] text = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)inputs = tokenizer(text, return_tensors="pt")outputs = model.generate(**inputs, max_new_tokens=256, temperature=0)print(tokenizer.decode(outputs[0], skip_special_tokens=True))