Would such a license fall under the definition of free software? Difficult to say. Counter-proposition: a license which permits training if the model is fully open.

My next project will be released under a GPL-like license with exactly this condition added. If you train a model on this code, the model must be open source & open weights

In light of the fact that the courts have found training an AI model to be fair use under US copyright law, it seems unlikely this condition will have any actual relevance to anyone. You're probably going to need to not publicly distribute your software at all, and make such a condition a term of the initial sale. Even there, it's probably going to be a long haul to get that to stick.

Not sure why the FSF or any other organization hasn't released a license like this years ago already.

Because it would violate freedom zero. Adding such terms to the GNU GPL would also mean that you can remove them, they would be considered "further restrictions" and can be removed (see section 7 of the GNU GPL version 3).

Freedom 0 is not violated. GPL includes restrictions for how you can use the software, yet it's still open source.

You can do whatever you want with the software, BUT you must do a few things. For GPL it's keeping the license, distributing the source, etc. Why can't we have a different license with the same kind of restrictions, but also "Models trained on this licensed work must be open source".

Edit: Plus the license would not be "GPL+restriction" but a new license altogether, which includes the requirements for models to be open.

That is not really correct, the GNU GPL doesn't have any terms whatsoever on how you can use, or modify the program to do things. You're free to make a GNU GPL program do anything (i.e., use).

I suggest a careful reading of the GNU GPL, or the definition of Free Software, where this is carefully explained.

> You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

"A work based on the program" can be defined to include AI models (just define it, it's your contract). "All of these conditions" can include conveying the AI model in an open source license.

I'm not restricting your ability to use the program/code to train an AI. I'm imposing conditions (the same as the GPL does for code) onto the AI model that is derivative of the licensed code.

Edit: I know it may not be the best section (the one after regarding non-source forms could be better) but in spirit, it's exactly the same imo as GPL forcing you to keep the GPL license on the work

I think maybe you're mixing up distribution and running a program, at least taking your initial comment into account, "if you train/run/use a model, it must be open source".

I should have been more precise: "If you train and distribute an AI model on this work, it must use the same license as the work".

Using AGPL as the base instead of GPL (where network access is distribution), any user of the software will have the rights to the source code of the AI model and weights.

My goal is not to impose more restrictions to the AI maker, but to guarantee rights to the user of software that was trained on my open source code.

It isn't the difficult, a license that forbids how the program is used is a non-free software license.

"The freedom to run the program as you wish, for any purpose (freedom 0)."

Yet the GPL imposes requirements for me and we consider it free software.

You are still free to train on the licensed work, BUT you must meet the requirements (just like the GPL), which would include making the model open source/weight.

Running the program and analyzing the source code are two different things...?

In the context of Free Software, yes. Freedom one is about the right to study a program.

But training an AI on a text is not running it.

And distributing an AI model trained on that text is neither distributing the work nor a modification of the work, so the GPL (or other) license terms don't apply. As it stands, the courts have found training an AI model to be a sufficiently transformative action and fair use which means the resulting output of that training is not a "copy" for the terms of copyright law.

Model weights, source, and output.