Which AI is best fo...
 
Notifications
Clear all

Which AI is best for writing complex Python code?

6 Posts
7 Users
0 Reactions
176 Views
0
Topic starter

Hi everyone! I am currently working on a fairly large backend project using FastAPI and some heavy data processing libraries. While I have used ChatGPT and Claude for simple scripts, I am starting to hit a wall when it comes to refactoring complex logic or handling intricate multi-threading issues.

I am looking for an AI that can really grasp the context of a whole repository rather than just single snippets. I have heard mixed things about GitHub Copilot and Cursor, especially regarding how they handle deep architectural changes.

  • Must handle complex decorators and async functions
  • Needs a large context window for multi-file projects

Has anyone here tested different models specifically for advanced Python architecture? Which one actually provides the most reliable code without constant hand-holding?


6 Answers
12

Id suggest being careful with raw APIs. Seconding the recommendation above.

  • Maybe try Codeium Individual since its free and avoids those huge token bills while handling complex logic.


10

In my experience, you should definitely check out Cursor Code Editor because it handles the whole repository context way better than a standard plugin. I am still kinda new to big backend stuff, but Cursor basically indexes your entire project folder so it actually knows about those decorators in your other files. I was worried about the cost, but for $20 a month, you get access to Claude 3.5 Sonnet and GPT-4o which is a pretty good value tbh. Here is why I suggest it:

  • It has a massive context window so it doesnt forget your async logic halfway through.
  • You can use the composer feature to refactor across multiple files which is highkey a lifesaver.
  • The codebase indexing makes it feel like it actually gets your architecture instead of just guessing. Be careful tho, sometimes it still hallucinates if your folder is huge, so make sure to double check the multi-threading bits. But yeah, it is way more reliable than just pasting snippets into a web chat. gl!


3

Seconding the recommendation above. Just a huge warning: watch your token usage if you go the raw API route. I am still somewhat new to these AI tools, but I once tried using keys to save money on a FastAPI project. I accidentally indexed my whole environment folder and the bill was actually higher than a subscription fee lol! If you aren't methodical, the budget-friendly way gets expensive fast.


3

This thread is gold. Bookmarking for future reference 🔖


2

Saving this whole thread. So much good info here you guys are awesome.


1

I'd actually suggest a different approach - while Cursor was mentioned already, those $20 monthly subs really add up. If youre doing heavy FastAPI work, you might find more success with a more flexible, budget-friendly setup. Over the years, I've found that raw API access is way more reliable for deep architecture.

  • Use Aider AI pair programming tool which is free and open-source.
  • Connect it to the Anthropic Claude 3.5 Sonnet API to pay only for the tokens you use.
  • It uses your git repo context to handle multi-file changes without the constant hand-holding. In my experience, this setup handles async logic better than most wrappers. Plus, your probably gonna save a ton of cash since it usually costs way less than a sub. It's a bit more technical to set up but seriously worth it... gl!


Share: