Each aspect of an IC, such as the 6N137, has to be considered to make a complete model. It helps to have some understanding of what tools are available within Spice and how to apply each of them to modeling problems. That takes both experience (with Spice) as well as study.
But I can help with thoughts about the LED portion, for example.
Let's look at this datasheet from Vishay (end-of-life'd by them in 2024, I see):
It's obviously a lousy chart. You can see that it just has two lines, joined at a knee. At best, I think, they may have taken three measurement points: \$1\:\text{mA}\$, \$10\:\text{mA}\$, and \$50\:\text{mA}\$. Then they just took out a ruler. So it's not much to go on.
But I can say a few things.
The equation is \$R_{_\text{TOT}}\approx \frac{\eta\,\cdot\,V_T}{I_{_\text{D}}}+R_{_\text{S}}\$. (Actually, the first term should include the saturation current in the denominator, but it is so tiny there's no reason to include it.) The first term is based on the Shockley diode equation's slope and the second term is simply the added bulk resistance of the device.
\$R_{_\text{TOT}}\$ is about \$3.4\:\Omega\$ at \$50\:\text{mA}\$ and about \$10\:\Omega\$ at \$5\:\text{mA}\$. You can see how that was estimated by looking at the red and green information. Just those two estimates, plus an assumption of \$V_T=25.9\:\text{mV}\$, suggest \$R_{_\text{S}}=2\frac23\:\Omega\$ and \$\eta\approx 1.42\$.
It's very ham-handed. But it gives a tentative \$R_{_\text{S}}=2.5\:\Omega\$. (It will be adjusted, later.) I also, at this point, take note that \$\eta\$ is larger than 1, which it should be. If it had solved out as less than 1, I would have questioned my process and/or the chart.
There's the Shockley diode equation bit to now worry over (\$\eta\$ and \$I_{_\text{SAT}}\$.) Focus on the low-current end of the chart where the value of \$R_{_\text{S}}\$ has a minor impact (at most \$25\:\text{mV}\$ at \$10\:\text{mA}\$) and allows a more microscopic view for these last two parameters.
While I have a possible starting value of \$\eta=1.5\$ (rounding), I need a starting \$I_{_\text{SAT}}\$. Compute as \$I_{_\text{SAT}}= 5\:\text{mA}\cdot\exp\left(\frac{5\:\text{mA}\cdot 2.5\:\Omega-1.31\:\text{V}}{1.5\,\cdot 25.9\:\text{mV}}\right)\approx 1.5\times 10^{-17}\:\text{A}\$.
There's enough to start a chart (using Desmos, for example.) Zoom into the low end while working. If nailing things at \$5\:\text{mA}\$, but under-shooting at \$10\:\text{mA}\$, then boost \$\eta\$ and lower \$I_{_\text{SAT}}\$. Etc.
In this case, I get \$\eta=1.7\$ and \$I_{_\text{SAT}}=8\times 10^{-16}\:\text{A}\$.
However, I also found that at \$50\:\text{mA}\$ the bulk resistance went too high. So I had to adjust \$R_{_\text{S}}=2\:\Omega\$ to make it all work out.
Here's the result:
And it hits on the key points pretty well. So I'd be satisfied with this result:
- \$R_{_\text{S}}=2\:\Omega\$
- \$\eta=1.7\$
- \$I_{_\text{SAT}}=8\times 10^{-16}\:\text{A}\$
The link you provided specifies many more parameters. And the simulation model does require them. But I usually just pick up the parameters from another diode using ako
to copy all of them and then just modify the ones I'm changing.
Here's an example using LTspice:
Which also gets pretty close, even though all those other parameters are coming from a small signal low-leakage diode and not an LED at all.
I have written code that does this pretty well with three points from a chart, where that chart is more realistic. But in a case like this where it seems pretty clear a ruler was used, it would be more of a manual process for me (assuming I cared to put in the time for it.)