A Git-inspired CLI utility for interacting with Large Language Models (LLMs) via the OpenRouter API.
loom brings version control concepts to prompt engineering and AI chat. Instead of linear chat histories, loom structures conversations into isolated workspaces containing branching dialogue trees. Messages act as commits - allowing you to branch off at any point, experiment with different prompts or models, and maintain complete control over your context.
Currently, loom supports text-to-text modality, with the unique ability to swap or update the active LLM after any message in the tree.
- Branching Dialogue Trees: Experience conversations like code. Fork your chat at any message to explore alternative AI responses or prompt variations.
- Isolated Workspaces: Organize your projects, tasks, or personas into separate workspaces.
- Model Agnostic: Swap the active model seamlessly mid-conversation.
- Streaming Responses: Token-by-token output directly in your terminal for real-time interaction.
- Interactive Logs: Easily navigate the history of your current branch.
Refer to INSTALLATION.md for installation instructions.
loom config --key YOUR_OPENROUTER_API_KEYloom init research-projectloom models add google/gemma-4-31b-it:free
loom models set google/gemma-4-31b-it:freeloom send "How do planes fly?"| Command | Git Analog | Description |
|---|---|---|
loom config --key <key> |
git config |
Sets the OpenRouter API key for requests. |
loom init <name> |
git init |
Creates a new workspace. |
loom ws <name> |
None | Switches to an existing workspace. |
loom workspace |
None | Lists all existing workspaces. |
loom status |
git status |
Displays the active workspace and branch. |
loom send <message> |
git commit |
Sends a message to the active model (streams response to console). |
loom checkout <name> |
git checkout |
Switches branches. Use -b flag to create and switch to a new branch. |
loom branch |
git branch |
Lists all branches inside the active workspace. |
loom log |
git log |
Opens an interactive window with the current branch's dialogue history. |
loom models list |
None | Lists locally available/configured models. |
loom models add <id> |
None | Automatically adds a model by its official OpenRouter ID. |
loom models set <id> |
None | Changes the active model for subsequent messages. |
# 1. Ask the initial question
loom send "Write a Python script to parse a CSV file."
# 2. Check the status and see you are on the default branch (e.g., 'main')
loom status
# 3. Create a new branch to explore an alternative approach (e.g., using pandas)
loom checkout -b use-pandas
# 4. Change the model to a more powerful one for this specific branch
loom models set anthropic/claude-3-opus
# 5. Continue the conversation on this branch
loom send "Now optimize it using the pandas library."
# 6. Switch back to the main branch anytime to follow the standard library path
loom checkout main