Skip to content

ktock/vscode-llmlet-gcc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vscode-llmlet gcc example

Example of https://github.com/ktock/vscode-llmlet

vscode-llmlet is experimental software. See remaining issues.

Example 1. Quick Start with a single browser

  1. Open this repo on github.dev: https://github.dev/ktock/vscode-llmlet-gcc-example?vscode-coi=on (if using . shortcut key, you need to add the ?vscode-coi=on query manually in the URL)
  2. Install the ktock.llmlet extension.
  3. Open LLMLET panel and enter a prompt describing tasks.

Example task prompt to make a mini "uname" command in C:

Write a small C program mini_uname.c that calls the uname() syscall of <sys/utsname.h>, gets the "struct utsname" data, and prints the kernel name contained in the sysname field of the struct.

Test it in the following steps.

- Compile it using gcc -o /tmp/a.out /workspace/<workspace-name>/mini_uname.c
- Run it and check if the kernel name printed by the program matches to the real uname command output.

Mini uname example

NOTE: See the OUTPUT panel for the progress. NOTE: A single browser is capable of running only small models such as qwen3.5 4b or smaller, so they might fail to complete complex tasks. Use the distributed inference feature to run a larger model on multiple browsers.

Example 2. Distributed inference on multiple browsers

For running a larger model, you can use multiple browsers connected to each other.

NOTE

  • As of now we don't offer the TURN server so peers can't connect each other if they are in network environments that don't allow P2P communication.
  • vscode-llmlet uses the PeerJS's public server for establishing the connection among peers by default. You can change the server using llmlet.peer.peerServer.

1. Open peers and enable this feature

  • Open github.dev on all browsers to connect to each other: https://github.dev/ktock/vscode-llmlet-gcc-example?vscode-coi=on (if using . shortcut key, you need to add ?vscode-coi=on query manually in the URL)
    • e.g. you might need 4-5 browsers to run Qwen3.5 9b.
  • Install the ktock.llmlet extension to all of them.
  • On each browser, go to the settings, set llmlet.peer.enabled to true, and reload the tab to enable this feature.
  • Open the LLMLET panel on all browseres to start the extension.

2. Specify a larger model

  • Choose one browser as a client. On the client browser, open the settings and set llmlet.model to https://huggingface.co/unsloth/Qwen3.5-9B-GGUF/resolve/main/Qwen3.5-9B-Q4_K_M.gguf (a GGUF-formatted Qwen3.5 9b by unsloth). Reload the client browser to reflect the setting.

As an example, the following runs 4 browser tabs connected to each other.

Mini ps example settings

3. Connect peers and start inference

  • On each browser, see the OUTPUT panel and find a [peer] Peer ID: <peerid> line which indicates the ID of each peer.
    • In this example, the peers received the following IDs
      • f2c14504-b4af-48e7-adab-0534dc67d230
      • 9e2bcdb4-61ac-4064-a48d-ede7f4d25957
      • 973b1bd6-c4fa-42b9-bcd4-95c23fec3169
      • 50c1a93c-fbc0-484c-ac38-d905d7775361
  • On each browser, open the settings and write the comma-separeted list of all peer IDs to llmlet.peer.peers. There is no need to reload the browser here.
  • On the client browser's LLMLET panel, enter a prompt describing the task.

Example task: implementing a mini "ps" command

Write a small C program psmini.c that lists running processes on Linux.

It should:

- iterate /proc
- detect numeric directories (process IDs)
- read /proc/<pid>/cmdline
- print: PID   CMD

Compile and run the program to show the process list.
You can use gcc installed in the system.

Mini ps example run

TERMINAL panel

In this example repository, the TERMINAL panel starts an alpine container with gcc installed.

The container runs fully inside browser using the QEMU-emulated x86_64 environment.

The workspace is visible at /workspace in the container.

HTTP(S) networking is available in the contaienr with restrictions by the browser (CORS restriction and no control over Forbidden headers).

You can use your own image by setting llmlet.container.image. See the vscode-llmlet README for details.

FAQ

See also the vscode-llmlet README for more information.

"SharedArrayBuffer is not defined" error occurs when launching the container

Add the ?vscode-coi=on query to the URL and reload to make SharedArrayBuffer available.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors