Skip to main content

Execute Custom - Template for Custom LLM Endpoints

==================================================

Executes tasks using custom LLM endpoints (OpenAI-compatible or REST API).

Usage: echo '{"task_id": "TASK-001", ...}' | python execute_custom.py

Input (stdin): JSON task specification Output (stdout): JSON execution result Exit Codes: 0 - Success 1 - Execution error 2 - Configuration error 3 - Task specification error

Environment Variables: CUSTOM_LLM_API_KEY - API key for authentication CUSTOM_LLM_ENDPOINT - Full API endpoint URL CUSTOM_LLM_MODEL - Model name (optional)

Copyright (c) 2025 AZ1.AI INC. All rights reserved. Developer: Hal Casteel, CEO/CTO Email: 1@az1.ai

File: execute_custom.py

Functions

read_task_from_stdin()

Read task specification from stdin.

validate_task_spec(task)

Validate task specification has required fields.

execute_custom_llm(task)

Execute task using custom LLM endpoint.

main()

Main execution entry point.

Usage

python execute_custom.py