How kenza-ai/sagify works
Sagify is a CLI for managing machine-learning workflows on AWS SageMaker, alongside an HTTP LLM Gateway for chat, embeddings, and image generation. The main workflow runs through CLI commands into cloud or LLM APIs, then SageMaker operations; gateway requests route to endpoint handlers and provider clients. The README documents OpenAI and SageMaker backends and deployment capabilities. Some API and provider wiring is unsampled, so those links are omitted or marked unverified rather than inferred.
Main entry points: commands CLI Commands · cloud.py Cloud API · sagemaker.py SageMaker Operations · routes.py Versioned Routes
Components 23
CLI and Configuration
- CLI Entry
sagify/__main__.py - CLI Commands
sagify/commands - Project Config
sagify/config/config.py
SageMaker Workflows
- Cloud API
sagify/api/cloud.py - LLM API
sagify/api/llm.py - SageMaker Operations
sagify/sagemaker/sagemaker.py - Streaming Inference
sagify/streaming_inference/streaming_inference.py - Training Templates
sagify/template/sagify_base/training/training.py - Inference Templates
sagify/template/sagify_base/prediction/prediction.py
LLM Gateway
- Gateway App
sagify/llm_gateway/main.py - Versioned Routes
sagify/llm_gateway/api/v1/routes.py - Chat Endpoint
sagify/llm_gateway/api/v1/endpoints/chat.py - Embedding Endpoint
sagify/llm_gateway/api/v1/endpoints/embeddings.py - Image Endpoint
sagify/llm_gateway/api/v1/endpoints/images.py - Request Schemas
sagify/llm_gateway/schemas - Gateway Services
sagify/llm_gateway/services
Model Providers
- Client Factory
sagify/llm_gateway/providers/client_factory.py - OpenAI Client
sagify/llm_gateway/providers/openai/client.py - Anthropic Client
sagify/llm_gateway/providers/anthropic/client.py - SageMaker Client
sagify/llm_gateway/providers/aws/sagemaker.py
Other components
- CLI User
- Model APIs
- AWS Services
Connections 29
- CLI User → CLI Entry: invokes
sagify/__main__.py - CLI Entry → CLI Commands: dispatches
sagify/__main__.py - CLI Commands → Cloud API: calls
sagify/commands/cloud.py - CLI Commands → LLM API: calls
sagify/commands/llm.py - CLI Commands → Project Config: reads config
sagify/commands/cloud.py - Cloud API → Project Config: loads config
sagify/api/cloud.py - Cloud API → SageMaker Operations: runs jobs
sagify/api/cloud.py - Cloud API → Streaming Inference: manages streams
sagify/api/cloud.py - SageMaker Operations → AWS Services: provisions models
- Streaming Inference → AWS Services: uses queues and functions
sagify/streaming_inference/streaming_inference.py - SageMaker Operations → Training Templates: uses training code
- SageMaker Operations → Inference Templates: uses inference code
- Gateway App → Versioned Routes: mounts routes
sagify/llm_gateway/main.py - Versioned Routes → Chat Endpoint: routes requests
sagify/llm_gateway/api/v1/routes.py - Versioned Routes → Embedding Endpoint: routes requests
sagify/llm_gateway/api/v1/routes.py - Versioned Routes → Image Endpoint: routes requests
sagify/llm_gateway/api/v1/routes.py - Chat Endpoint → Request Schemas: uses DTOs
sagify/llm_gateway/api/v1/endpoints/chat.py - Embedding Endpoint → Request Schemas: uses DTOs
sagify/llm_gateway/api/v1/endpoints/embeddings.py - Image Endpoint → Request Schemas: uses DTOs
sagify/llm_gateway/api/v1/endpoints/images.py - Chat Endpoint → Gateway Services: delegates
sagify/llm_gateway/api/v1/endpoints/chat.py - Embedding Endpoint → Gateway Services: delegates
sagify/llm_gateway/api/v1/endpoints/embeddings.py - Image Endpoint → Gateway Services: delegates
sagify/llm_gateway/api/v1/endpoints/images.py - Gateway Services → Client Factory: selects clients
sagify/llm_gateway/services/embeddings.py - Client Factory → OpenAI Client: creates client
sagify/llm_gateway/providers/client_factory.py - Client Factory → Anthropic Client: creates client
sagify/llm_gateway/providers/client_factory.py - Client Factory → SageMaker Client: creates client
sagify/llm_gateway/providers/client_factory.py - OpenAI Client → Model APIs: calls provider API
sagify/llm_gateway/providers/openai/client.py - Anthropic Client → Model APIs: calls provider API
sagify/llm_gateway/providers/anthropic/client.py - SageMaker Client → AWS Services: invokes endpoints