| with_lms_daemon | R Documentation |
Temporarily starts the LM Studio headless daemon, executes the provided R expression, and then gracefully shuts the daemon and any active servers down. This is ideal for automated scripts and pipelines.
with_lms_daemon(code)
code |
An R expression to execute while the daemon is running. |
The result of the evaluated code.
Be cautious using this wrapper if you already have the LM Studio GUI open.
While the setup phase (lms_daemon_start) will succeed, the teardown phase
(lms_daemon_stop) does not stop the daemon, because the CLI prevents
programmatic shutdowns of the graphical interface. The teardown prints an
info message, and the daemon keeps running. This wrapper is best reserved
for strictly headless environments or fully automated scripts.
## Not run:
result <- with_lms_daemon({
lms_load("llama-3.1-8b")
lms_chat("llama-3.1-8b", input = "Hello world!")
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.