Skip to content

rh-aiservices-bu/grimoire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Grimoire - AI Prompt Experimentation & Production Platform

A comprehensive enterprise-grade web application for experimenting with, testing, and productionizing AI prompts. Built with FastAPI and React, Grimoire provides seamless integration with Llama Stack servers, advanced backend testing capabilities, automated evaluation systems, and complete GitOps workflows for professional prompt management.

๐Ÿš€ Features

Core Functionality

  • ๐Ÿฆ™ Llama Stack Integration: Direct connection to Llama Stack servers with configurable provider IDs and model parameters
  • ๐ŸŽ›๏ธ Advanced Model Controls: Fine-tune temperature, max_len, top_p, and top_k parameters with real-time preview
  • ๐Ÿ“ก Streaming Responses: Real-time Server-Sent Events (SSE) streaming from Llama Stack inference with delta updates
  • ๐Ÿ”ง Template Variables: Dynamic prompt templates using {{variable}} syntax with validation and substitution
  • ๐Ÿงช Backend Testing Framework: Comprehensive testing against external API endpoints with performance analytics
  • ๐Ÿ“Š Evaluation System: Automated prompt evaluation with LlamaStack scoring functions and dataset integration
  • ๐Ÿ“ Interactive History: Rich prompt and test history with ratings, detailed notes, and search capabilities
  • ๐Ÿ’ฌ Multi-Message Conversations: Support for System/User/Assistant role-based conversations with context management
  • ๐Ÿง  Thought Process Extraction: Automatic extraction and display of model reasoning from <think> tags
  • ๐ŸŽฏ Prompt Management Interface: Visual prompt browser with production promotion workflow and status tracking

Production & GitOps Workflow

  • ๐Ÿ”— Multi-Git Platform Support: Full integration with GitHub, GitLab, and Gitea (including self-hosted instances)
  • ๐Ÿ”„ Automated Pull Requests: Automatic PR creation for production deployments with branch management
  • ๐Ÿญ Production API: External REST endpoints for retrieving production-ready prompt configurations
  • ๐Ÿ” Secure Authentication: Fernet-encrypted Git credential storage with platform-specific token support
  • ๐Ÿ“ˆ Git History Integration: Unified commit tracking and production prompt versioning
  • โšก Real-time Sync: Live PR status updates and repository synchronization
  • ๐ŸŽฏ Test โ†’ Production Workflow: Visual promotion pipeline with approval gates and production tracking
  • ๐Ÿ“‹ Pending PR Dashboard: Real-time monitoring of deployment status with merge tracking
  • โš™๏ธ Git-based Settings: Version-controlled test configurations and environment management

Enterprise Deployment

  • ๐Ÿณ Container-First Design: OpenShift-compatible containers with non-root users and health checks
  • โ˜ธ๏ธ Kubernetes Native: Complete Helm charts with ingress, persistent storage, and service mesh support
  • ๐Ÿ› ๏ธ Development Tools: Docker Compose setup, development workbenches, and debugging containers
  • ๐Ÿ“ฆ Multi-Architecture: Support for x86_64 and ARM64 container builds
  • ๐ŸŽจ Modern UI: PatternFly React components with responsive design and enterprise branding
  • ๐Ÿงญ Intuitive Navigation: Sidebar navigation with project-specific menus and organized feature sections

Quick Start

Prerequisites

  • Python 3.9+, Node.js 18+, npm
  • Llama Stack server running with available model providers (e.g., llama-3.1-8b-instruct)

Development

# Backend
cd backend
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.py

# Frontend (new terminal)  
cd frontend
npm install
npm run dev

Access at http://localhost:5173 (frontend) and http://localhost:3001 (backend API)

Production Deployment

Docker Compose:

docker-compose up -d

Container Build:

# Backend container
cd backend && podman build -t grimoire-backend:latest -f Containerfile .

# Frontend container
cd frontend && podman build -t grimoire-frontend:latest -f Containerfile .

Kubernetes:

helm install grimoire ./helm --set ingress.enabled=true

๐ŸŒ API Reference

External Integration APIs

  • GET /api/projects-models - Discover available projects and model configurations
  • GET /prompt/{project_name}/{provider_id} - Retrieve latest prompt configuration with variables
  • GET /prompt/{project_name}/{provider_id}/prod - Get production-ready prompts from Git repository
  • POST /api/projects/{id}/test-backend - Test prompts against external backend APIs with streaming
  • POST /api/projects/{id}/eval - Run automated prompt evaluations with LLM-as-judge scoring
  • GET /api/projects/{id}/test-settings - Retrieve Git-stored test configurations and variables
  • GET /api/git/quick-status - Quick Git authentication status check
  • GET /api/projects/{id}/git-changes - Check Git repository status and pending changes

Interactive Documentation

Core API Features

  • ๐Ÿงช Backend Testing: POST /api/projects/{id}/test-backend - Stream external API tests with metrics
  • ๐Ÿš€ Generation: POST /api/projects/{id}/generate - Stream LlamaStack responses with SSE
  • ๐Ÿ“Š Evaluation: POST /api/projects/{id}/eval - Run automated evaluations with scoring
  • ๐Ÿ”„ Production Workflow: POST /api/projects/{id}/history/{historyId}/tag-prod - Create production PRs
  • ๐Ÿ” Git Authentication: POST /api/git/auth - Multi-platform Git integration (GitHub/GitLab/Gitea)
  • ๐Ÿ“ˆ History Management: Full CRUD operations for prompt and test history with Git integration
  • โš™๏ธ Settings Management: GET/POST /api/projects/{id}/test-settings - Git-based configuration storage
  • ๐Ÿ“‹ PR Tracking: GET /api/projects/{id}/pending-prs - Real-time pull request status monitoring
  • ๐Ÿ”ฌ Backend Test History: GET /api/projects/{id}/backend-history - Comprehensive test result tracking
  • ๐ŸŽฏ Test Promotion: POST /api/projects/{id}/backend-history/{historyId}/tag-prod - Promote backend tests to production

Advanced Features

  • ๐ŸŒŠ Streaming Support: Server-Sent Events for real-time responses with token-by-token updates
  • ๐Ÿ”ง Template Engine: Dynamic {{variable}} substitution with validation and live preview
  • ๐Ÿ“‹ Git Operations: Automated repository management, PR creation, and status tracking
  • โš™๏ธ Settings Management: Git-based configuration storage with version control
  • ๐Ÿ’ฌ Conversation Management: Multi-turn dialogues with System/User/Assistant role support
  • ๐Ÿง  Thought Extraction: Automatic detection and display of model reasoning process
  • ๐ŸŽฏ Visual Promotion Pipeline: Interactive Test โ†’ Production workflow with approval gates
  • ๐Ÿ“ˆ Performance Analytics: Response time tracking, error monitoring, and success metrics
  • ๐Ÿ“Š Dataset Integration: HuggingFace dataset support for evaluation and batch processing

License

MIT License

About

Your spellbook for managing prompts ๐Ÿช„๐Ÿ”ฎ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published