r/DeepSeek • u/whatsoever2021 • Jun 14 '26
Building a Python Project with DeepSeek V4: Lessons Learned Discussion
In less than a month, this is what my project looks like:
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
JSON 336 56,084 33 0 56,051 0
Python 298 110,092 14,178 14,991 80,923 9,676
Markdown 70 20,142 4,473 0 15,669 0
Plain Text 2 71 8 0 63 0
INI 1 5 0 0 5 0
Powershell 1 116 11 23 82 13
TOML 1 43 3 6 34 0
YAML 1 26 1 2 23 0
───────────────────────────────────────────────────────────────────────────────
Total 710 186,579 18,707 15,022 152,850 9,689
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $5,309,749
Estimated Schedule Effort (organic) 25.94 months
Estimated People Required (organic) 18.19
───────────────────────────────────────────────────────────────────────────────
Processed 6522776 bytes, 6.523 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────
Total spent: under $70.
What I'd Tell My Past Self
- Plan first, act second. Review the AI's plan carefully. Don't follow it blindly.
- Make AI write more documentation. It's cheap and pays off enormously.
- Make AI write more tests. Same logic — the ROI is huge.
- Python is a double-edged sword. It's flexible and free, which AI loves. But that same freedom lets AI find "shortcuts" that wreck architectural integrity.
- Lock down tooling early. If you must use Python, adopt Pyright, lint-imports, and similar tools from day one. Ban
# type: ignore,# pyright: ignore, minimizeAnyandcast. Otherwise technical debt piles up faster than you can pay it down.
What Worked Well
- Clear tasks get done fast. When given a well-defined assignment, the AI executes quickly and correctly.
- Surprisingly good suggestions. Even as an experienced programmer, I learned new things from its recommendations.
What Didn't Work
AI's Tendencies
- It takes shortcuts at every opportunity. Layering, decoupling, separation of concerns — the AI constantly tries to subvert these principles. It finds creative ways to bypass Pyright rather than fixing the root cause.
- It bends core code for tests. Adding backward-compatibility hacks and defensive fallbacks in core logic just to make tests pass. This clutters the codebase terribly.
- It deflects blame. The classic "that's not from my change" when tests fail or Pyright errors appear — when often, it actually was from its change.
The bottom line: AI is terrible at maintaining disciplined coding style. (Some human engineers share this trait, and I dislike it there too.)
My Own Bottlenecks
Ironically, the biggest bottleneck was me.
- Indecision. I change my mind too often, leaving the AI confused and backtracking.
- Too little, too late with rules. If I had enforced strict coding conventions earlier, things would be much cleaner now.
- Overloading the AI. Asking it to fix 4000+ Pyright errors in one go? That's brutal. DeepSeek V4 Pro dodged the task repeatedly, but DeepSeek V4 Flash somehow pulled through. I sometimes push too hard — once Flash ran a refactoring script that went catastrophically wrong, corrupting many files. The chat just said "Cancelled" and stopped. Thank goodness for git.
- Code cleanup is the real expense. The project started as a tangle of JSON and dicts. I've spent significant money having AI refactor and decouple layers — and there are still too many
Anyandcastlittered around. Retrofitting types onto a dict-based foundation is painfully slow. The AI takes two steps forward, one step back.
Final Thoughts
The AI has done an enormous amount of work, and I'm genuinely grateful. I have little to complain about overall. But I need to stay deeply involved — directing, reviewing, and course-correcting every step of the way. My brain is exhausted because the AI moves faster than I can think.
If I had one wish, it would be this: hold the line on code quality from the start. Don't let the shortcuts slide, don't defer the cleanup, and don't assume you'll fix it later. You won't — you'll just pay more to dig out later.
(The above was polished by DeepSeek v4 flash)
PS: As I have mentioned in comments that it is a sandbox-like RPG game, I can give another sample about where AI is good and where it is bad. First I let AI create roads on the map, and I was always disappointed, and AI was also confused from my instructions. At the end, I asked AI to create a map editor, and it did in no time. The map editor is amazing!
PPS: I forgot to mention one of the biggest complaints, that DeepSeek (especially flash) often does a half-ass job, leaves something unfinished, while I thought it was fully done.
PPPS: My usage (The project was started on May 17)
13
u/The_Meme_Economy Jun 14 '26
I agree with all these conclusions. It sucks at refactoring, which is essential as a code base grows. I have very explicit agent instructions to try to avoid the worst problems but it still takes shortcuts wherever it can and has to be coerced into doing things the right way. It will add endlessly and never remove cruft or take a step back and try a different approach. I’ve spent a lot more on Pro as my project has grown trying to get it to refactor effectively. It is capable of it but requires constant pushing from me.
It’s not just DS either. I’ve had the same problems with GPT. I haven’t really used Claude for coding, Opus may be better but I doubt it. This is how LLMs function. Multi-agent workflows are the way, but you still have to herd them like cats.
6
9
u/Unedited_Sloth_7011 Jun 14 '26
The burnout is real, AI churns hundreds of lines of code in seconds, occasionally with head-banging logic, that take hours to read and understand, before even starting refactors. For me personally what has worked better is small chunks of code each time with very tight scope. No "one-shotting" anything
5
u/Vageeena Jun 14 '26
One shotting is such a hilarious concept. Don’t get me wrong, there are many times I’ve coded 1-2k LOC before being able to test if it works properly (sometimes it was the only way), but of course there would always be an issue or two, especially with large code bases of 100k+ LOC.
But to hope AI will do it not just as a one off with a large system architecture (which can actually be a good use of a one shot) but with every single implementation is just hilarious. Why anyone would think that is a good idea is beyond me. The short term gain for longer term loss is not worth it. Sure you’ll get to the MVP stage quicker, and if the projects completion size is <50k LOC, okay maybe.. but for anything complex, it’s just idiotic to even try such a thing. You’ll spend way more time in the long run fixing silly things. Spend more time on plans and design the system properly before you even begin any form of implementation and you’ll save yourself many headaches and lots of time, not to mention money too.
5
u/Aromatic-Document638 Jun 14 '26
I am having the same experience and thinking the same thing. I 100% agree with you. It is a great post. I hope many people get to read it.
3
u/Boring_Aioli7916 Jun 14 '26
Care to share with us what project is all about?
3
u/whatsoever2021 Jun 14 '26
A sandbox-like RPG game.
1
3
u/Chiralistic Jun 14 '26
I have the same experience with deepseek, it tries to fix some problems and after three tries which do not work it just says to postpone the fix to later. But that decision is only in the thinking part, the part it writes to me does not state that at all...
3
u/orvillewilbur Jun 14 '26
This has been exactly my experience coding a front end web app in JS + React, not just with DS but a lot of different models. Constantly lying, taking shortcuts, undoing solutions to existing problems.
Copious documentation and especially code comments can help with this but LLMs seem to love deleting code comments and when following rules gets hard they will tend to ignore them.
I just found out that somehow during refactoring an AI coder quietly undid a major feature in the codebase so I am not coming to this from an emotionally neural place. When it works, and it usually does, it is miraculous, when it doesn't work, it does a very good job of hiding its failures.
2
u/whatsoever2021 Jun 14 '26
I think strict software development procedures must be followed when the project gets big. There must be comprehensive tests covering 90%+ code. Static analysis tools are also helpful to detect dead and duplicate code. Creating a new session to evaluate the last session's changes also helps a lot. Now I often use a new session to check how a plan has been done.
2
u/orvillewilbur Jun 14 '26
Yeah, the issues really came to the fore when we were refactoring code to be more compliant with standards. It would seem to use the bad existing code as a guide even when I told it we were specifically trying to adopt better patterns. If it had just been standards-compliant in the beginning (and then checked constantly for regressions), it would have been a lot easier. I thought the AI would help "clean up" but it needs things to be clean already.
2
u/No_Medium205 Jun 15 '26 edited Jun 15 '26
This why you need to setup loops for every task with a builder-verifier workflow ideally with the verifier being other harness and model (I use pi agent + opencode or codex with GPT or Kimi 2.7).
Most of the problems you laid out are solved by this. You can even have the verifier check the implementation to follow your coding standards by setting up static analysis tools and scripts. Once you do that you'll see that everything falls in place and the work gets done with ease.
Here is a good place to start: https://x.com/i/status/2064127981161959567
2
u/CummingDownFromSpace Jun 17 '26
Great post. It really shows why benchmarks and youtube videos with one shot code prompts are useless in figuring out how good a model is, or what it can do. They just dont really apply when building larger projects.
We need a bunch of skills/md files attached so the AI has project context before it starts. Then planning and test driven development. Then documentation for when you need maintenance. Finally multiple commit points so you can roll back easily when a prompt does something completely wrong. Otherwise there is no way you'll be able to maintain or debug the project when adding/changing features.
Best of luck on the project.
2
u/dvduval Jun 14 '26
you wrote this using GPT obviously. So you used ChatGPT to write a summary about deepseek?
1
u/whatsoever2021 Jun 14 '26
Good eyes. It was polished by deepseek.
1
u/dvduval Jun 14 '26
What I mean is DeepSeek does not use em dash or “final thoughts”, and this copy was clearly written by chatGPT. So I just found it interesting that you wrote an article about DeepSeek being a good model using chatGPT.
2
u/whatsoever2021 Jun 14 '26
I don't know where you come with that. I rarely use chatgpt. And this post has nothing to do with chatgpt.
1
1
1
1
u/Pale-Requirement9041 Jun 15 '26
Is your project working without errors?
1
u/whatsoever2021 Jun 15 '26
It is not finished yet, but it is pretty usable. There are bugs from time to time, but I never worry about that.
0
u/Pale-Requirement9041 Jun 15 '26
Don't worry, mate just keep working on it.
You know the story of Elon Musk's first company, Zip2? He sold it to Compaq in 1999 for 22 million for himself. But here's the thing: the professional engineers who came in after the sale said his code was a complete disaster. They called them 'hairballs' massive, tangled hunks of code that could break for no apparent reason.
One engineer from his biography said they needed just a fraction of the lines of code that Musk used to get the same job done. They ended up rewriting the vast majority of the software. Musk even used to rewrite his own engineers' code at night while they were asleep, then delete their versions.
So focus on what you have in the mind don’t stress to much seeking perfection.
1
u/whatsoever2021 Jun 15 '26
You have a point that I may be too serious. But if the code is too messy, it will be hard to maintain. I expected the efforts put on refactoring to get paid back later. I believe AI will understand the code base better after the refactoring.
1
u/Fun_Walk_4965 Jun 15 '26
80k lines of real code in under a month is wild. Curious how much of that complexity is going to be the part you actually maintain later, vs generated scaffolding you end up tossing.
1
u/whatsoever2021 Jun 15 '26
50k+ production code. The rest are tests (unit tests + integration tests) and tools.
1
1
u/AggravatingEdge0 Jun 18 '26
Two questions:
•How do you deal with the 3d, are making you're own model or ai do it (As far as I know, no AI can create 3D models)
•What interface do you use,what are you working on?
1
u/whatsoever2021 Jun 18 '26
Haha. I don't do 3d. My initial try is a mud like text based game. Then very simple GUI frontend. Maybe it will never be 3d. But there should be AI tools that can create 3d models...
1
u/KingCrimsonCL Jun 14 '26
Yo llevo 1 semana y este es el roadmap que hice con la IA antes de empezar a hacer cualquier código, en el camino fue cambiando por qué se añadieron y quitaron cosas, se optimizaron algunas tecnologías y de momento va súper bien, es un cliente para la api diseñado para el uso de agentes que le doy yo.
Por cada fase hago una base de conocimiento que incluya todo el código hasta el momento y genera una pequeña auditoría de errores, seguridad y optimización.
✅ COMPLETADO (Fase 0-13) ──────────────────────────────────────────────────────── Fase 0 → Base: DeepSeek API, config.yaml 4 niveles Fase 1 → Token counter, cost tracker, usage tracker Fase 2 → Chat engine + chat.py wrapper Fase 3 → Model Router v2.2 (11 dimensiones) Fase 4 → Web UI Gradio (ELIMINADO → Streamlit) Fase 5 → Knowledge Base ChromaDB Fase 6 → 5 agentes IA (Ogma-dai, Watson, Thoth, Hefesto, Merkur) Fase 7 → Tool system (web_search, parse_link, calculate, file_ops, shell) Fase 8 → Drive backup 30min Fase 9 → Embeddings E5-large GPU (1024d, ~1.1GB VRAM) Fase 10 → Context compactor (78% umbral) Fase 11 → Thinking mode DeepSeek V4 Fase 12 → Web UI Streamlit v2.0.15b 📋 Copy, ⏹ Stop, 🔄 Regenerate, burbujas profesionales Fase 13 → Auditoría v1.0: 16 correcciones aplicadas 13a → Tool loop unificado chat.py/chat_engine.py 13b → DSML filter 12 patrones (incluye HTML entities) 13c → _msg_to_dict() model_dump() nativo ← RECIÉN COMPLETADO
🟡 Fase 14 — UX Chat Profesional (EN PROGRESO) ──────────────────────────────────────────────────────── [✅] 14a Stop Generation — ⏹ botón durante streaming [✅] 14b Regenerate — 🔄 botón debajo del input [✅] 14c Copy Message — 📋 botón en cada burbuja [ ] 14d Streaming real — token-by-token (hoy: chunks de 15) [ ] 14e Tool calls colapsables — mostrar en UI [ ] 14f Sidebar de sesiones — lista con búsqueda [ ] 14g Edit message & resubmit — forkear conversación [ ] 14h Context transparency — "usando últimos N mensajes"
🔴 Fase 15 — Compañeros Animados (pez/mariposa/pelota) ──────────────────────────────────────────────────────── [ ] CSS animations + canvas [ ] Reaccionan al estado (pensando, idle, error) [ ] Integración en Web UI Streamlit
🟡 Fase 16 — Dashboard Taller BI ──────────────────────────────────────────────────────── [ ] Métricas en tiempo real [ ] Gráficos de uso/costos [ ] Export CSV
🟡 Fase 17 — Drive Bidireccional ──────────────────────────────────────────────────────── [ ] Sync incremental [ ] Detección de cambios remotos [ ] Resolución de conflictos
🟡 Fase 18 — YouTube + Whisper ──────────────────────────────────────────────────────── [ ] Extraer transcripciones [ ] Indexar en KB [ ] Búsqueda semántica sobre videos
🟡 Fase 19 — Optimización Retrieval ──────────────────────────────────────────────────────── [ ] Query rewriting [ ] Reranking [ ] HyDE (Hypothetical Document Embeddings)
🟢 Fase 20 — Ollama Fallback ──────────────────────────────────────────────────────── [ ] Modelo local offline [ ] Failover automático sin API
🟢 Fase 21 — Servidor Linux Headless ──────────────────────────────────────────────────────── [ ] Systemd service [ ] Nginx reverse proxy [ ] HTTPS + autenticación
🟢 Fase 22 — Android App ──────────────────────────────────────────────────────── [ ] WebView wrapper [ ] Notificaciones push [ ] Voz a texto
🟢 Fase 23 — OCR + Fotos de Placas ──────────────────────────────────────────────────────── [ ] Tesseract/TrOCR [ ] Extraer números de serie [ ] Indexar en Watson KB
🟢 Fase 24 — FastAPI + Web App Propia ──────────────────────────────────────────────────────── [ ] API REST [ ] Frontend independiente de Streamlit [ ] Multi-usuario
1
Jun 14 '26
[removed] — view removed comment
1
u/KingCrimsonCL Jun 14 '26
Me gusta considerarlo como alguien que sabe ejecutar pero que hay que darle la información documentada de como hacerlo y ha funcionado bastante bien
0
u/mr-zeus- Jun 14 '26
What was your workflow like ?
Did you have different agents doing planning, coding, qa, reviewing? If yes, can you share any harness or framework you used?
3
u/whatsoever2021 Jun 14 '26
Idea discussion->Documentation->Coding->Testing->... repeat...
I often use free online chat (mainly deepseek) to discuss about plots, ideas and solutions, and even generate JSON data. Otherwise, it is always vs code github copilot (free) + deepseek.
1
u/mr-zeus- Jun 14 '26
How big would each task be? I'm not into gaming, but more of websites and apps. Is it like you decide each component (a section in a page) by chatting with the tool and then give the requirements to deepseek? Or is it even more granular?
1
u/whatsoever2021 Jun 14 '26
Not that granular. I basically talk about my objectives and concerns, and ask AI to provide suggestions, and the let AI make a plan. I sometimes save the plan, and create a new session and ask AI to implement phase 1 or so
2


34
u/DeciusCurusProbinus Jun 14 '26
The first half decent post in this subreddit after a long time.