TL;DR
I recently made significant changes to the content-automation repository, focusing on improving the Craft API integration and model management. The key changes include updating the craft_publisher.py to handle array payloads for documents, switching to the meta-llama/llama-4-scout-17b-16e-instruct model, and implementing dual endpoint fallback for Craft publisher.
The Problem
The primary issue was that the Craft API was expecting an array in the documents payload, but the current implementation was not providing it. This resulted in errors and prevented the successful creation of documents in Craft. Additionally, there were issues with the model used for content generation, which needed to be updated to a more suitable one.
What I Tried First
Initially, I attempted to modify the craft_publisher.py file to include the necessary array structure in the payload. However, I encountered issues with the model used for content generation, which was llama3-70b-8192. I tried using this model but faced problems with thinking blocks in the output.
The Implementation
To fix the issue with the Craft API, I updated the craft_publisher.py file to include the array structure in the payload. The changes can be seen in the following code snippet:
def _create_document(
self, title: str, content: str, tags: List[str]
) -> Optional[str]:
"""Creates document in Craft. Returns doc ID or None."""
payload = {
"title": title,
"content": content,
"tags": tags,
"fields": [
{"key": "title", "value": title},
{"key": "content", "value": content},
],
}
# ... rest of the function ...
I also updated the model used for content generation to meta-llama/llama-4-scout-17b-16e-instruct. This involved modifying the settings.yml file and the main.py file to use the new model.
Key Takeaway
The key takeaway from this experience is the importance of carefully reviewing the API documentation and ensuring that the payload structure matches the expected format. Additionally, it's crucial to test and validate the changes to prevent errors and ensure smooth functionality.
What's Next
In the next steps, I plan to implement further improvements to the content automation process, including exploring other models and fine-tuning the existing ones. I also aim to enhance the error handling and logging mechanisms to ensure better visibility into the process.
Code Changes
The code changes can be found in the following commits:
-
9eb58ec5: fix: Craft API espera array en documents β payload corregido fix: migrar a meta-llama/llama-4-scout-17b-16e-instruct β todos los modelos anteriores decomisionados
Tags
vibecoding #buildinpublic #AI #Productivity #CraftAPI #ContentAutomation
Part of my Build in Public series β sharing the real process of building SaaS projects from Playa del Carmen, MΓ©xico.
Repo: zaerohell/content-automation Β· 2026-06-24
#playadev #buildinpublic







