Skip to content

Skelf-Research/blogus

Repository files navigation

Blogus

package.lock for AI prompts.

Extract prompts from your codebase, version them like dependencies, and keep everything in sync.

License: MIT PyPI version

Why Blogus?

Approach Discover Version Test Sync Lock
Inline strings - - - - -
Manual .txt files - Git - Manual -
LangChain Hub - Yes - Manual -
PromptLayer / Humanloop - Yes Yes Manual -
Blogus Auto Git Yes Auto Yes

Blogus is different because it:

  • Extracts prompts from your existing code (no migration required)
  • Locks versions with content hashes (like package.lock)
  • Syncs changes back to your source files automatically

Quick Start

# Try it now
uvx blogus scan

# Install
uv add blogus

1. Extract

Find all LLM calls in your codebase:

$ blogus scan

Found 3 LLM API calls:
  src/chat.py:15         OpenAI      unversioned
  src/summarize.py:42    OpenAI      unversioned
  lib/translate.js:28    Anthropic   unversioned

2. Version

Create .prompt files:

$ blogus init
# prompts/summarize.prompt
---
name: summarize
model:
  id: gpt-4o
  temperature: 0.3
variables:
  - name: text
    required: true
---
Summarize in 2-3 sentences: {{text}}

3. Lock

Generate a lock file:

$ blogus lock
# prompts.lock
prompts:
  summarize:
    hash: sha256:a1b2c3d4...
    commit: 4903f76

4. Sync

Update your code when prompts change:

$ blogus fix
# Before
content = "Summarize: " + text

# After
# @blogus:summarize sha256:a1b2c3d4
content = load_prompt("summarize", text=text)

5. Verify (CI)

$ blogus verify || exit 1

Commands

Command Description
scan Find LLM API calls in your code
init Create prompts directory
prompts List all .prompt files
exec <name> Run a prompt with variables
analyze Evaluate prompt effectiveness
test Generate test cases
lock Generate prompts.lock
verify Check lock file (for CI)
check Find unversioned prompts
fix Sync code with .prompt files
demo Launch interactive TUI demo

Web UI

uvx --with blogus[web] blogus-web

Browse prompts, scan projects, and commit changes at http://localhost:8000.

Interactive Demo

Experience Blogus with an interactive terminal demo - perfect for presentations and learning.

# Install with TUI support
uv add blogus[tui]

# Launch the demo
blogus demo

The demo walks through:

  • Scan - Live detection of prompts in a sample project
  • Analyze - LLM-powered effectiveness scoring
  • Compare - Side-by-side multi-model output
  • Fix Workflow - Check/Fix/Lock/Verify in action

Options:

blogus demo --speed slow     # Slower animations for talks
blogus demo -p ./my-project  # Demo with your own project

.prompt Format

---
name: code-review
description: Review code for bugs
model:
  id: gpt-4o
  temperature: 0.3
variables:
  - name: code
    required: true
  - name: language
    default: python
---
Review this {{language}} code for bugs:

{{code}}

How It Works

┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐
│  SCAN    │───▶│  VERSION │───▶│   LOCK   │───▶│   SYNC   │
│          │    │          │    │          │    │          │
│ Find LLM │    │ .prompt  │    │ prompts  │    │ Update   │
│ calls    │    │ files    │    │ .lock    │    │ code     │
└──────────┘    └──────────┘    └──────────┘    └──────────┘

Documentation

License

MIT

About

Extract prompts from your codebase, version them like dependencies, and keep everything in sync.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors