United 2nd
a compact language model for local chats
2 min readupdated
Built from scratch by developer Rasuljanov Muhammadali, United 2nd is a custom autoregressive Transformer (Transformer, a neural network architecture for text processing) with around 300M parameters. It supports text generation and multi-turn conversations while maintaining context. Because it is not integrated directly into the standard Transformers library, it uses a custom loading pipeline and a Gradio interface for running locally. It is ideal for experimentation, building text prototypes, and exploring compact custom architectures.
Key features
- Around 300M parameters and a custom PyTorch implementation featuring SwiGLU, RMSNorm, and RoPE architecture
- Context support up to 512 tokens and conversational history using user-assistant turn pairs
- Adjustable generation parameters, including temperature and top-k sampling
- Includes a ready-to-use Gradio interface (
app.py) for quickly launching a chat
What you can do
- Run a local chatbot for text experiments via the built-in Gradio interface
- Test the compact language model on your own lightweight generation tasks
- Integrate the model into Python scripts to generate responses and manage chat history
Example
from modeling_united_2nd import load_united_2nd
pipe = load_united_2nd("united_2nd_v1.pt")
result = pipe.generate(
"Explain how HTTPS protects data in transit.",
history=[],
max_new_tokens=110,
temperature=0.15,
top_k=25,
)
print(result["reply"])
Read more
Details• Architecture: 18 layers, hidden size 1024, FFN size 2816
• Attention: GQA (16 query heads and 4 KV heads)
• License: Apache-2.0
• Limitations: no built-in moderation, internet access, or official benchmarks










Comments