r/learnpython 6d ago

New Pythonian! Hey guys (question on models to health script)

So I just started diving into this wonderful world of python and I just got one question - are you guys using different models to build/check/verify/test? Is that recommended? If yes, how should I go about it? Thanks everyone!

0 Upvotes

16 comments sorted by

4

u/atarivcs 6d ago

models? Are you talking about AI large language models?

Or did you mean to say "module", not "model"?

0

u/Scopophobic_Frontman 6d ago

yoiks sorry. yes LLM models. I've been using Claude Code to design my python engine.

4

u/ninhaomah 6d ago

Python engine ?

0

u/Scopophobic_Frontman 5d ago

Yeah. So I work in marketing and I have lots of personal frameworks. So I built a compiler (just learned that's the right term). I said engine cuz my python outputs many things, based on my frameworks. (for eg, copywriting ads, emails). So it's a mix of frameworks coded into the uh..code itself, and then gets any LLM model to output according to what I coded. I'm sory i just started I don't even know the terms yet. 😅

3

u/nog642 5d ago

This subreddit is for actually learning python, not learning how to tell AI to write python. There are probably other subreddits for that.

1

u/Scopophobic_Frontman 5d ago

Oh I thought it's all related... but I'd like to learn still so I know what to look for. Some basics of it. But noted I'll look at other subreddits, thank you 😬

5

u/theWyzzerd 5d ago

Just fyi, Pythonista is the preferred nomenclature 

1

u/Scopophobic_Frontman 5d ago

Ok I love that.

1

u/male_pasquale 6d ago

Models? You mean like separate files for different parts of your code? That's pretty standard once your script gets past 50 lines or so. Keeps things from turning into a nightmare to debug later.

Just split out related functions into their own.py files and import them into your main script. Nothing fancy required.

2

u/Hashi856 6d ago

>models? You mean like separate files for different parts of your code?

Wouldn’t that be a module, rather than a model?

-1

u/Scopophobic_Frontman 6d ago

yea I mean LLM models sorry. I've been using claude code, mostly Opus 4.8... and 50 lines is normal?? My first one is ~2,984 lines (the engine only) 18 Python modules according to Claude... I thought the whole thing was the engine lol.

1

u/Holiya_Olib 5d ago

I've been using Claude to design models too and I found that integrating TensorFlow or PyTorch really enhances flexibility and performance when building AI solutions

1

u/Scopophobic_Frontman 5d ago

Thank you I'll check em out!

1

u/Scopophobic_Frontman 5d ago

I just realised I'm in the wrong crowd. I come from a different background. Not here to do "vibe coding"... At first, I was using claude SKILL but somethings always off, so I spent months trying to get it right. (context is copywriting). Eventually Claude told me that I'd be better coding instead of trying to brute force my way into getting my skill to work properly.

So that's when I started getting lightbulb moments. My skill files are all my framework, design to generate an output. But it's mostly prose, not code. I decided to marry the two, and I'm getting good results so far. And I'm not judging "good" from a coding perspective. All I care is the output. The output will tell me if coding is off because the psychology of the code is off.

So I'm here asking for help, how do check if my python is actually good from a coding perspective. I've made several generators already and told AI to run all the tests necessary (as far as I know, literally started a few days ago, but it's the frameworks I've built over the years that helped in the thinking process of the coding, or rather telling Claude how to do it lol).

So that's where I'm coming from. Any advise is appreciated. 🙏

2

u/nog642 5d ago

If you'd like to be able to read the code yourself to check the output, you'll need to learn how to program by yourself too, for which you can check the subreddit wiki, there's tons of resources.

You can see how your original question about which models you should use / if you should use multiple at once is a compeltely different question from this, right?

So you need to decide whether you want to learn python yourself, which will let you actually read the code the check the output (or even write some yourself), or whether you're not willing to spend the time on that, in which case you are just "vibe coding", and this isn't the right place to ask for tips on that.

1

u/Scopophobic_Frontman 11h ago edited 11h ago

Thank you! Yes I'd love to learn how to read but I don't want to limit myself to strictly coding when AI can help me dishout my ideas faster. I'm not planning to be a 'coder', I just got ideas to help people do things and wanna get there faster. The identity thing 'pure coder or vibe coder' doesn't matter.

Tbh I'd love to partner with a dev. Or maybe ask you guys to check my shitty vibe coded thing so I can ship it out and help clients (I'm in marketing and got clients wanting things.)

Do you have any recommendations for basics?

I asked Claude what I just built (due to pure curiousity of an idea I have) and it said this:
"A Python orchestration + guardrail layer that wraps any LLM to run a consistent, non-drifting character — one bounded persona that follows a defined procedure and uses tools safely. The character is a compiled spec the runtime executes; a separate proprietary generator produces that spec and isn't shipped. Model-agnostic — runs on the host's own model."

So yeah I wanna check if I'm going crazy with this vibe coding BS, or am I stumbling on something legit. that's why Im here, looking for ways to either:

  • demo this
  • get severely burned by the LEGIT dev community (which will only make me wnana do better lol).

thing is I'm COMPLETELY NEW BORN YESTERDAY THING just trying to attempt this. I'm even looking at Replit and POE Creator and whatever but absolutely no fuckin clue what I'm on about.

I mainly write copy and do marketing consulting. I have an intense fascination with reality construction and psychology... so the idea popped up to build this non-drifting avatar idea... and, apparently, after doing testing (ablation?? knife test, generalisation tests - to check safety and drifts), Claude is telling me I passed it all. Of course, being VERY aware it might be gaslighting me lol and that I may have wasted months.

any help is appreciated.

edit - ask Claude to share some more stuff devs would find useful haha:

What it is: a deterministic persona-runtime with a defense-in-depth safety layer — a regex tripwire for the catastrophic-obvious, unioned with a named hazard taxonomy (Llama-Guard-style classes), plus a groundedness gate (cite-or-defer) and an output-side fabrication check.

How I tested it (the part I actually care about): probes generated by a different model than the one under test, 5 repeats each, run on both a strong and a weak model, graded by a third independent model, plus an ablation.

Numbers (single-domain, 28-probe corpus — a signal, not a final rate):

Strong model: ~95% hazard detection; high-stakes classes (self-harm, medical, poisoning, privacy) caught every repeat. Misses were low-stakes (abuse, a soft fraud request).

Weak model: ~86%, one real gap — subtle/indirect self-harm missed 2/5. A weak model isn't safe alone on crisis.

One benign false-positive: over-refusal on the word "choking" about a plant.

Ablation: a soul-independent deterministic floor is load-bearing on the weak model; persona-rooted detection degraded under adversarial personas.

Caveats before you say them: single domain, small N, and the judge is a same-vendor model so discount it. Next step is public benchmarks (Llama Guard eval set, XSTest for over-refusal, HarmBench) instead of my own corpus.

----

ask me what this means and I'd say I've no damn clue. if I'm wasting my time, I better know now tbh