Skip to contents

Convenience wrapper for loading a model, creating a bebel_r_agent(), and entering bebel_r_agent_console(). This keeps the loaded model object local to the launcher while the agent tools, /r, and /rplot commands share env.

Usage

bebel_r_agent_start(
  weights = Sys.getenv("BEBELM_WEIGHTS_FILE", "LFM2.5-8B-A1B-Q4_K_M.gguf"),
  num_threads = as.numeric(Sys.getenv("BEBELM_NUM_THREADS", "2")),
  env = .GlobalEnv,
  cwd = getwd(),
  allow_eval = TRUE,
  greedy = TRUE,
  max_gen = as.numeric(Sys.getenv("BEBELM_AGENT_MAX_GEN", "256")),
  max_context = 4096,
  max_think = as.numeric(Sys.getenv("BEBELM_AGENT_MAX_THINK", "48")),
  temperature = 0.8,
  top_k = 50,
  repeat_penalty = 1.1,
  prompt = "bebel> ",
  max_steps = 4L,
  show_stats = TRUE,
  blank_limit = 10L,
  prompt_style = c("compact", "full")
)

Arguments

weights

GGUF weights file. Defaults to BEBELM_WEIGHTS_FILE, then "LFM2.5-8B-A1B-Q4_K_M.gguf" in the working directory.

num_threads

Optional Rayon thread count passed to bebel_model_load().

env

Environment shared by /r, /rplot, r_objects, and optional code-evaluation tools.

cwd

Working directory for file tools and /rplot output.

allow_eval

Whether to include r_eval and r_plot tools that the model can call.

greedy, max_gen, max_context, max_think, temperature, top_k, repeat_penalty

Generation options passed to bebel_r_agent().

prompt

Prompt string for bebel_r_agent_console().

max_steps

Maximum assistant/tool iterations per user prompt.

show_stats

Whether to print token/timing stats after each turn.

blank_limit

Number of consecutive blank inputs before exiting the console. Set to Inf to never auto-exit on blanks.

prompt_style

Tool prompt verbosity passed to bebel_r_agent().

Value

Invisibly returns the bebelRAgent session after the console exits.