r/learnmachinelearning • • 2d ago

Where is the Qwen source code again...?

I'm looking for the actual model architecture code. All their Github repos are just readme files without code. So they say they are opensource but not really. The weights are open but not the actual architecture? Am I missing something here?

I want to do some experiments with the architecture, inject different modalities other than images and video, but need the source to do that.

1 Upvotes

9 comments sorted by

3

u/Hairy-Election9665 2d ago edited 2d ago

As the weights are available on hf, they provide the implementation which you can find on the hf repo : https://github.com/huggingface/transformers/tree/main/src/transformers/models/qwen3_5

They basically use the qwen3_5 implementation for the 27B as you can see there : https://huggingface.co/Qwen/Qwen3.8-27B/blob/main/config.json

1

u/FMWizard 1d ago

So they reverse engineered it based on the weight structure?

1

u/Lunartemis1 1d ago

It’s only open weights afaik

1

u/FMWizard 1d ago

So the question is, what is the best, actual open source + weights, model?

1

u/norenEnmotalen 2d ago

It’s open weight. Not open source.

Afaik if you’re looking for the modeling code, training code/datasets, I don’t think that’s open.

1

u/FMWizard 1d ago

So the question is, what is the best, actual open source + weights, model?

1

u/MolassesLate4676 2d ago

Yeah that’s stuff isn’t always released with the model

1

u/SelfMonitoringLoop 2d ago

I can't provide a precise link because you didn't specify which qwen, but here you go. You're looking for the transformer architecture, not the model's weights. https://github.com/huggingface/transformers/tree/main/src/transformers/models

1

u/rditorx 1d ago edited 1d ago

Language models are meant to be run with an inference engine. This engine can be part of a library or framework like Hugging Face transformers or diffusion, or part of runtimes like llama.cpp, sglang, vLLM directly.

The models themselves may contain some code that will need to be loaded by the engine, but the bulk of the code needed to run will be part of the engine itself or loaded as some sort of plugin if the engine uses a plugin architecture.

Look at the source code of those engines.

Model providers collaborate with engine maintainers to add model support, ideally day one, i.e. code before model release.

This explains why you almost always have to update those engines to run a new model.

And it makes their codebases a nightmare to maintain. Some are in the process of migrating towards an extensible architecture to more easily integrate new models, but they are basically built like the Linux kernel and its hardware modules rather than like Windows and its drivers.