For any text generation, I want to use a model which I have already downloaded locally. This model should only be used for txt generation in things like post captions, story captions, comments, comment replies etc, and should be told when and what to generate by the agent that we already planned. Update the file structure to include that
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below is an updated, self-contained file structure that cleanly separates “core RL logic” from “local text generation.”
I added a dedicated language_model/ package (plus a small tweak to a few other folders) so the agent can call your already-downloaded model for captions, comments, replies, etc., without ever touching the Internet or any SaaS API.
ai_agent/prompt_manager.py
• Builds context-rich prompts: “Write an engaging 150-char Instagram caption for product X with hashtag list Y …”
• Optionally injects past conversation history for comment threads.
ai_agent/filters.py
• Runs a fast local toxicity/profanity classifier (or rule-based filter) on text BEFORE posting.
browser_control/instagram_actions.py
• Whenever it needs any text, it calls:
You can now plug in any offline model (Llama, GPT-J, etc.) simply by dropping weights into language_model/cache/ and updating config.yaml—no other code changes required.
Let me know which submodule you’d like to implement first, or if you want starter code for the loader & generator!