How cranium-ai/demo_public_repo works
Project type and purpose
• This is a multi-scenario demonstration library for machine learning tasks, organized into three pillars:
• LLM-based demos (chatbots, RAG, Q&A)
• Non-LLM ML tasks (CV, speech, image-to-text)
• Traditional data-science pipelines (regression, classification, scientific modeling)
• It’s not a single end-user application, but a reference toolkit illustrating various pipelines and integrations with external APIs (OpenAI, AWS Bedrock, Hugging Face, etc.).
File structure
• Top-level directories:
• data_science/ – classic ML pipelines
• llm/ – subfolders for each LLM provider or pattern
• non_llm/ – CV, ASR, random non-LLM model demos
• Each subfolder groups one scenario.
• requirements.txt lists shared Python dependencies.
• No central “orchestrator” code is provided, so assume usage via direct script invocation or an ad-hoc CLI.
README for additional insights
• README enumerates scenarios but does not specify a single integration layer.
a. Main components
• “Demo Runner” (could be a CLI or notebook launcher)
• Three module clusters:
1. Data Science Modules
2. LLM Modules
3. Non-LLM Modules
• Shared Utilities / Common Libraries
• External Services & APIs
• Data Sources (if any local CSV or scientific data)
b. Relationships & interactions
• Demo Runner → invokes individual scenario scripts in each module cluster
• Scenario scripts → import shared utilities
• LLM modules → call out to external LLM APIs (OpenAI, AWS Bedrock, Meta LLaMA endpoints, etc.)
• Non-LLM CV/ASR modules → load local model code or call hugging-face models
• Data Science modules → run scikit-learn or custom algorithms on local data
c. Architectural patterns & design principles
• Modular plugin-style structure: each scenario is isolated in its own package
• Separation of concerns: grouping by domain
• Dependency inversion for external services: scenario code depends on abstract interfaces in “shared” utilities, with concrete clients for each provider
d. Key technologies & frameworks
• Python 3.x, requirements.txt
• scikit-learn, statsmodels (data_science)
• langchain, pinecone, openai SDK, boto3 (llm/rag/aws_bedrock)
• pytorch/tensorflow, torchvision, blip-utils (non_llm/image_classification, image_to_text)
• torchaudio or Whisper wrapper (speech_recognition)