Create Your Own Bash Computer Use Agent with NVIDIA Nemotron in One Hour

Originally published at:Create Your Own Bash Computer Use Agent with NVIDIA Nemotron in One Hour | NVIDIA Technical Blog

What if you could talk to your computer and have it perform tasks through the Bash terminal, without you writing a single command? With NVIDIA Nemotron Nano v2, you can easily build a natural language Bash agent from scratch, in under an hour, and with roughly 200 lines of Python code with minimal dependencies. This…

Hi, I enjoyed this work and I have a few questions I wanted to ask.

  1. I tried to deploy this on my RTX4090, yet I faced an error about the plugin, I ran the vLLM like this:

export TP_SIZE=1 # Adjust this value based on the number of GPUs you want to use
docker run --runtime nvidia --gpus all
-v ~/.cache/huggingface:/root/.cache/huggingface
–env “HUGGING_FACE_HUB_TOKEN=$HF_TOKEN”
-p 8000:8000
–ipc=host
vllm/vllm-openai:v0.10.1
–model nvidia/NVIDIA-Nemotron-Nano-9B-v2
–tensor-parallel-size ${TP_SIZE}
–max-num-seqs 64
–max-model-len 131072
–trust-remote-code
–mamba_ssm_cache_dtype float32
–enable-auto-tool-choice

But the error that is thrown is:
raise TypeError("Error: --enable-auto-tool-choice requires "
TypeError: Error: --enable-auto-tool-choice requires --tool-call-parser

  1. How do you think tools like this would evolve to be used in the future?
  2. In the video, you mentioned that we can use larger models. What trade-offs does using Nemotron have?

Thank you for reaching out, and happy to hear you enjoyed my work :)

Your deployment command appears mostly correct, but as noted on the model card you’ll need to also supply the following two parameters:

--tool-parser-plugin "/path/to/nemotron_toolcall_parser_no_streaming.py" \ --tool-call-parser "nemotron_json" \ 

Make sure to also include appropriate -v specification in your docker command so that the path "/path/to/nemotron_toolcall_parser_no_streaming.py" gets resolved correctly inside docker.

If I understood your question correctly, you’re referring to command line agents? Is so, then I think because many applications provide command line interfaces, agents that can use these interfaces will be helpful across the board. Stay tuned for more work on expanding this work :)

The compute requirements, as well as the agent’s interaction speed might be some things to consider when using larger models, depending on your priorities, especially if your hardware is geared towards smaller models.

Hope this helps!

1 Like

Hi Mehran,

I ran the code, but besides “pwd” nothing else seems to work in my Windows laptop. It seems the model works only in Linux. Could you please let me know how to resolve this compatibility issue?

See below:

[🤖] Thinking…
The cd c:\ command did not change your directory. The error might be due to path recognition issues in this environment. Would you like to:

  1. Try cd C:\ (with a capital “C”)?
  2. Use cd / to navigate to the root of the current drive?
  3. List files in the current directory with ls to check for issues?

Hello and thanks for reaching out!

Just to confirm, are you running this on Windows directly (through the Powershell or the command prompt), or did you try running through Windows Subsystem for Linux (WSL)? Asking because only WSL is supported at the moment.

Hi Mehram,
I am running directly on Windows. This explains why this doesn’t work. Do you have any plans on supporting Windows natively?
Regards,
DT

One could have achieved the task using a Bash program alone or with Python program as well. Then how is the use fo Agent any better ..? There is an additional complexity introduced(overhead as well). Still any ways you have to redine the subprocess function, the guardrails(list of commands etc)… What is the real use case in this example atleast ?

Let’s try one thing:

Could you try changing the system prompt for the agent from “You are a bash assistant…” to “You are a windows command line assistant…”, then adjust the allowed commands list (e.g. change ls to dir, etc). You would also need to adjust the root directory path to some sandbox path on your machine.

Thank you for sharing your thoughts!

This can go beyond the execution of basic commands :) One interesting use-case that I’ve personally tried and works well is to create docker files with some specifications. Here’s an actual example I tried recently:

User: Create a Dockerfile, based on nvidia/cuda:13.0.1-cudnn-devel-ubuntu24.04 and add some programs like ncdu and bash-completion. Then enable passwordless sudo for all users.

This led to the creation of new Dockerfile with the following content:

# Use the specified NVIDIA CUDA base image FROM nvidia/cuda:13.0.1-cudnn-devel-ubuntu24.04 # Install required packages RUN apt-get update && \ apt-get install -y ncdu bash-completion # Enable passwordless sudo (add this line to /etc/sudoers) RUN echo '% ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 

You could also try this with git or other CLI tools to create and execute composite commands that might need some creative thinking.

I’m sure there are other creative ways of using this simple agent, and I look forward to hearing more ideas!

Hi Mehran,

I tried to switch to Windows Command Line both within the code and interactively, but I couldn’t make it work. See evidence below.

DT