Bosquet Documentation

repository·main·Indexed 18 days ago

https://github.com/zmedelis/bosquet

Bosquet is a CLI tool (`bllm`) for running LLM generations using structured prompts and context data. It supports multiple service providers including :openai, :cohere, :openai-azure, :lmstudio, and :mistral. The tool provides management commands for API keys via the `keys` action and model parameter configuration via the `llms` action.

Tokens
951
Snippets
3
Records
4
Agent score
14%

What's inside Bosquet

  1. Use the Bosquet CLI for LLM generation

    main

    The Bosquet CLI tool (bllm) allows you to run LLM generations using either a raw prompt string or a prompt file containing structured templates (chat, graph, or plain string).

    Generation Modes

    1. Prompt String: Pass a string directly to trigger generation using the default model.
    2. Prompt File: Use the -p or --prompt-file flag to provide a file containing the prompt template. If a --data-file is not provided, the CLI will interactively prompt you for the required data slots.

    Common Options

    • -p, --prompt-file PROMPT-FILE: File containing the prompt template.
    • -d, --data-file DATA-FILE: File containing context data (as a Clojure data structure) for the prompts.
    • --model MODEL: Specify the model name (e.g., :gpt-4).
    • --max-tokens NUMBER: Maximum tokens to generate (default: 300).
    • --temperature TEMP: Generation temperature between 0.0 and 1.0 (default: 0).
    • -s, --service SERVICE: LLM service provider (e.g., :openai, :cohere).
    • --proxy: Use a local proxy (localhost:8080) for logging.
    • --proxy-host HOST / --proxy-port PORT: Specify a custom proxy host and port.
    • --keystore-password PSW: Password for the Bosquet keystore (defaults to changeit).
    # Run with a prompt string
    bllm "Hello, how are you?"
    
    # Run with a prompt file and data file
    bllm --prompt-file my_prompt.clj --data-file my_data.clj
    
    # Run with specific model and temperature
    bllm "Summarize this: ..." --model :gpt-4 --temperature 0.7
  2. Reference: Bosquet CLI Options

    main

    The following flags are available for the bllm command:

    FlagLong FlagDescription
    -p--prompt-file PROMPT-FILEFile containing either chat, graph, or plain string prompt
    -d--data-file DATA-FILEFile containing context data for the prompts
    --model MODELModel name (parsed as keyword)
    --max-tokens NUMBERMax tokens to generate (default: 300, must be > 0)
    --temperature TEMPGeneration temperature (default: 0, must be between 0.0 and 1.0)
    -s--service SERVICELLM service provider (parsed as keyword)
    --proxyUse locally configured (localhost:8080) proxy for request/response logging
    --proxy-host HOSTHostname for the proxy
    --proxy-port PORTPort for the proxy
    --keystore-password PSWPassword to Bosquet keystore (defaults to 'changeit')
    -h--helpShow help text
  3. Manage LLM service keys with `keys` action

    main

    Use the keys action to manage API keys for different LLM service providers.

    • keys set [service name]: Securely set an API key for a specific service. It will prompt you for the key in the console.
    • keys list: List all registered services that currently have keys configured.
    • keys path: Show the path to the configuration file where keys are stored.
    # Set a key for OpenAI
    bllm keys set :openai
    
    # List all configured keys
    bllm keys list
  4. Manage model parameters with `llms` action

    main

    Use the llms action to configure default model settings and view supported services.

    • llms set: Set the default model parameters (e.g., default service).
    • llms defaults: Show the current default service.
    • llms list: Show a list of supported LLM services (e.g., :openai, :openai-azure, :cohere, :lmstudio, :mistral).
    # Show supported services
    bllm llms list
    
    # Show current defaults
    bllm llms defaults