Bosquet
Tooling to build LLM applications: prompt templating and composition, agents, LLM memory, and other instruments for builders of AI applications.
Last verified:
What is Bosquet?
Bosquet is an open-source LLMOps library for Clojure designed to make building AI applications simple. It provides tooling for Large Language Model-based applications, including prompt templating and composition, agents, LLM memory management, and other instruments specifically for builders of AI applications. The library addresses key challenges in AI application development such as managing complex prompt templates that grow in complexity, handling limited LLM context windows through memory management, and enabling agents to interact with the outside world.
Key features include LLM and Tool service management, prompt templating via integration with the Selmer templating library, prompt chaining and composition through a powerful Pathom graph processing machine, agent and tools definition abstractions for interactions with external APIs, LLM memory handling, and call response caching. Bosquet supports tools for chats with both OpenAI and Ollama-based models, provides a command-line interface for generating completions, and enables multi-turn chat conversations with system, user, and assistant roles.
Bosquet is designed for Clojure developers and AI application builders who need to construct nontrivial AI applications. It is particularly suited for developers working with LLMs who need prompt templating capabilities, agent frameworks, and memory management. The library is used in the Scicloj community for implementing research papers with LLMs and is available on Clojars as io.github.zmedelis/bosquet.
The tool returns structured conversation data including :bosquet/conversation (full chat with generated parts filled in) and :bosquet/completions (containing only generated data). It supports defining custom tools with descriptions and parameter types for LLMs to call, making it useful for building AI agents that can interact with external APIs and perform calculations or other tasks.
Bosquet pricing
Pricing model: Freemium
Free and open source under Eclipse Public License 1.0 (EPL 1.0). The library is available on Clojars as io.github.zmedelis/bosquet with latest version 2025.10.15. No paid tiers or subscription plans exist. Users only pay for external LLM API costs (OpenAI, Ollama, etc.) when making API calls. The Eclipse Public License allows building proprietary products with Bosquet and distributing them with or without the library itself.
Bosquet pros
- Open source with EPL 1.0 license allowing free use and modification
- Prompt templating via Selmer templating library integration
- Pathom graph processing machine for powerful prompt chaining and composition
- Built-in LLM memory handling for context management
- Supports both OpenAI and Ollama-based models
- Command-line interface for easy testing and generation
- Call response caching to reduce API costs and latency
- Agent and tools definition abstractions for external API interactions
- Multi-turn chat conversation support with system/user/assistant roles
- Tool function definitions with descriptions and parameter types for LLMs
- Returns structured conversation and completions data
- Configurable model parameters like temperature and max tokens
- API keys stored securely in secrets.edn file
- Active Scicloj community support and use in research
- Clojure library running on JVM for Java ecosystem integration
Bosquet cons
- Requires Clojure programming knowledge and JVM setup
- Documentation marked as WIP (work in progress)
- Steep learning curve for developers unfamiliar with Clojure
- API keys must be manually configured in secrets.edn
- No built-in GUI or web interface, CLI and code only
- Limited to Clojure/ClojureScript ecosystem
- Selmer templating requires learning its syntax
- Pathom graph processing adds complexity for simple use cases
- No official paid support or enterprise plans available
Frequently asked questions about Bosquet
What is Bosquet?
Bosquet is an open-source LLMOps library for Clojure that provides tooling to build LLM applications. It includes prompt templating and composition, agents, LLM memory management, and other instruments for builders of AI applications. Its mission is to make building AI applications simple by handling complex prompt templates, managing limited LLM context windows through memory, and providing agent abstractions for external world interactions.
How do I install Bosquet?
Bosquet is available on Clojars as io.github.zmedelis/bosquet. You can include it in your Clojure project dependencies. The latest version is 2025.10.15. For local development, clone the repository from GitHub at https://github.com/zmedelis/bosquet and install Leiningen as the Clojure project management tool, then run lein deps to install dependencies.
How do I set up my API key?
API keys are stored in the secrets.edn file. First, make a copy of config.edn.sample to config.edn for local parameters. Then use the CLI command 'clojure -M -m bosquet.cli keys set openai' to set your API key for OpenAI (change 'openai' to a different service name if needed).
How do I set the default LLM model?
Use the CLI command 'clojure -M -m bosquet.cli llms set --service openai --temperature 0 --model gpt-4o' to set the default model. You can change the service name (e.g., 'ollama'), temperature, and model name according to your needs.
What models does Bosquet support?
Bosquet supports OpenAI models (like gpt-4o) and Ollama-based models. Tools for chats are supported for both OpenAI and Ollama-based models similar to ragtacts. You can configure different models per call using wkk/model-params with model parameter.
How do I use prompt templating?
Bosquet integrates with the Selmer templating library for prompt templating. You can use template syntax like '{{variable}}' in your prompts. For file-based prompting, use 'clojure -M -m bosquet.cli -p demo/play-writer-prompt.edn -d demo/play-writer-data.edn' with separate prompt and data files.
What does the generate function return?
The generate function returns #:bosquet{:conversation [...]} listing the full chat with generated parts filled in, and #:bosquet{:completions {...}} containing only the generated data. It also returns :usage information with prompt/completion/token counts and :time for execution time.
What is the Pathom graph processing machine?
Pathom is a powerful graph processing machine used by Bosquet for prompt chaining and composition. It enables complex workflows where multiple prompts are connected in a graph structure, allowing data to flow between different prompt templates and LLM calls, enabling sophisticated AI application patterns like self-evaluation workflows.