Hey everyone! It's my first post, so this is fun. I've been building a pipeline for a project I really want to start. On the surface, it's basically a Financial Analyst for myself. What I am really trying to do is push it to be as accurate as it can be through systems development. So this is the current pipeline by far:
Input the top 50 stocks of the S&P ->
Filter stocks ( process still in design ) ->
Pass all filtered stocks (if any) to Haiku ->
Filter again using qualitative data such as news and market trends ->
Stock data can be discarded, saved in a JSON file as potentially useful, or passed along ->
Pass all filtered stocks and qualitative data (if any) to a more powerful model (Sonnet or higher) ->
Use all provided data, including pattern records from the backtesting stage, to output a clear decision with a reason ->
Pass the output to another model for critiquing. If the critique would be minor, skip. Otherwise, return the critique to the previous model to revise and repeat ->
Replicate the decision in paper trading during backtesting to record performance results ->
Pass the results to an AI model to output an explanation for why this happened, along with a confidence rating (which can also be passed back into the model for a quick critique pass) ->
Record the explanation and result permanently in a JSON file ->
If the same result occurs several times and the explanation is similar, pass the data back to Sonnet to modify the core strategy.
I'm also planning to add a backtesting mechanic that uses all of the data to search for correlations between two variables, test them across several historical periods, log them if they're consistent, and forward-test them in the current market until they're fully validated as a usable pattern for the current model.
Can you list all of your suggestions and critiques? Try being helpful, not rude, etc.
Top comments (6)
hi, I'm the founder and CEO of AGI Systems Directorate. over at my company, we mostly build our own custom models driven by biological brain replication to push toward true AGI, so seeing people tackle agentic workflows from scratch is always class.
mapping out multi-step filtering, backtesting, and critique loops like that is a proper headache to get right. the approach is solid, but if you can, definitely try running your own models or self-hosted weights. relying heavily on external API wrappers is going to test your patience when you start stacking up 403s, 404s, 504s, 429 rate limits, or those random payment required walls on free tiers.
how are you handling those fallback scenarios right now—do you have logic in place to switch between different providers when an API drops, or are you just letting it fail?
solid pipeline for a first project, keep building.
Seriously such to your own models if you can. In my company we are building our artificial intelligence models.
Thank you for your feedback. The biggest problem with locally running a model on my machine is it's capacity. My laptop right now has only 16GB of RAM, and the models I can host on it locally (without my computer lagging immensely/crashing) are greatly behind Claude Sonnet in it's reasoning under complex situations. I have already decided to use try/except blocks so that if something were to fail, the program would handle it far better than just crashing. However, i am looking for anything better (if you have anything to say).
I don't know why but reading this gave me instant flashbacks because I totally dealt with those exact same 16GB RAM out of memory crashes before starting my company. Back then we couldn't even create or train models locally because it always crashed with out of memory errors since you can't fit that weight scale in local RAM. Nowadays in my company we deal with H100s, H200s, and Tensor Processing Units (TPUs), but I still remember that exact grind. Honestly relying purely on try and except blocks for a pipeline that complex is just going to swallow your exceptions and leave you blind when an API drops mid backtest. Since you are working with strict hardware limits on a 16GB machine, drop the local model heavy lifting entirely for now and use a tiered cascading architecture. Run a tiny quantized model locally via llama cpp just for the initial blunt stock filtering to keep your RAM footprint tiny, and route the actual heavy reasoning to lightweight cloud endpoints or batch your API calls. More importantly, dump your intermediate pipeline states into a local SQLite database or use joblib caching at every single step. That way if you hit a rate limit or a crash, your script recovers the exact state from disk instead of restarting the whole workflow from scratch. Solid project for a first build though, keep pushing.
Lol, pretty sure everybody has been at the 16 gigs phase🥀
And I'll use that advice, thanks.
If I get any new ideas, I'll come back.
Or progress too.
You know what, I could rent a cloud GPU to fine-tune a cloud model, and then keep it on the cloud, not locally. It is much cheaper than buying an overpowered computer.
Sorry for the late reply, I was buried in legal paperwork and compliance reviews for my company all morning. Honestly, nobody warns you before starting a company that half your day stops being writing code and becomes dealing with board meetings and corporate bureaucracy, which I definitely do not enjoy.
You are completely spot on with that realization though. Offloading fine-tuning and inference to the cloud saves your local RAM, protects your laptop hardware, and means you never have to worry about storing massive model weights locally.
If you want to set this up cleanly without wasting money, you have a few solid routes depending on how you want to run your code. If you want pure Python scripts from your terminal without messing with Jupyter notebooks or infrastructure, use Modal. You just add a decorator to your Python function, specify the GPU you want, and it spins up serverless containers on the fly so you only pay for the exact seconds your code runs. Another great alternative in that same vein is RunPod or Vast.ai if you just want cheap, raw cloud VMs where you can SSH in and run your own scripts with persistent network volumes. Lightning AI is also around for persistent storage and running notebooks or scripts with SIM verification to unlock credits, though I had trouble signing up there myself, and with their new account restrictions after that security incident, I would keep Lightning AI on standby until they clear that up and you can get an account. Kaggle GPUs are another option if you are willing to go through ID and Persona verification, where you can join competitions and unlock perks, though I personally do not recommend dealing with that verification and legal headache.
For free tiers, Google Colab gives you a free T4 GPU and even limited access to v5e-1 TPUs in a Jupyter notebook environment, and upgrading to Colab Pro or Pro+ unlocks L4s, A100s, H100s, and G4s. That said, I personally do not prefer Google Colab much because it disconnects sessions aggressively if you stop paying attention to the browser tab, though it works if you stay active on the tab.
Hugging Face is also a great option, and I personally recommend it because it gives you public visibility and you can drop your HF profile link right into your portfolio. When you host your app publicly as a Hugging Face Space, people can find it, like it, and actually try it out without you stressing over GPUs. Unlike Modal where you deal with SSH or GPG keys and that kind of setup, HF Spaces keeps things simple with a standard app.py file. Keep in mind Docker is not available on the free tier, so you need to upgrade to Pro to use Docker Spaces. I personally prefer Docker over plain Gradio because the default Gradio UI can feel a bit clunky, though if you stick to the free tier, Gradio is a solid choice where you define your requirements.txt. You can also use ZeroGPU dynamic resource allocation on Spaces, or upgrade to Pro if you want persistent GPU instances.
Seriously, it is wild because you are literally taking my path. That is pretty much how I ended up here too. I also started on my local machine, hit out of memory errors, and now here I am as the Founder and CEO of AGI Systems Directorate. Since I have gone through pretty much every cloud GPU setup out there, feel free to ping me anytime if you hit a snag with containers or fine-tuning configs. I am glued to my screen most of the day anyway. No pressure at all, and I am completely cool continuing right here on dev.to, though if you ever want to chat on Telegram or collaborate on something down the line, just let me know.