Top 10 : How Portugal Built a Powerful 9B Sovereign AI Model on a Budget
Portugal’s contribution to the Free and Open Source Software (FOSS) ecosystem is characterized by a high-performing developer community, legal frameworks that prioritize open standards, and an aggressive, forward-thinking push into open-source artificial intelligence.
While smaller in scale than massive tech superpowers, Portugal punches well above its weight by focusing on open governance, sovereign infrastructure, and highly collaborative community nodes.
1. The 2026 Sovereign AI Push: The "Amalia" Model
Portugal has officially carved out its space in the global open-source AI landscape.
The Amalia LLM: Backed by the government and €5.5 million in EU recovery funds, a consortium of Portuguese universities and research institutions launched Amalia. Named after the legendary fado singer Amália Rodrigues, this large language foundation model, along with its complete training dataset and source code, has been fully released under an open-source license.
Supercomputing Infrastructure: To drive this FOSS AI effort, Portugal leverages local cutting-edge infrastructure, running training and applications natively on the Deucalion and MareNostrum 5 supercomputers.
2. A Thriving, High-Impact Developer Ecosystem
Portugal boasts a highly dense and active developer community that consistently ships global-tier code:
Global GitHub Footprint: According to recent ecosystem insights, Portugal has over 27,000 active developers contributing heavily to open-source repositories on GitHub. This footprint is anchored by massive tech hubs in Lisbon and Porto, alongside rapidly emerging hubs in Braga and Aveiro.
Elite Maintainers: The local community features world-renowned open-source maintainers and creators. High-impact Portuguese developers like jonasschmedtmann, m1guelpf, and nunomaduro (a massive figure in the PHP/Laravel ecosystem) have collectively gathered hundreds of thousands of GitHub stars, proving that great code pairs perfectly with a pastel de nata.
3. Open Government & Replicable Public Platforms
Portugal is an international pioneer in using open-source architecture to empower its democratic and civic infrastructure, led primarily by the AMA (Agency for Administrative Modernization).
Participa.gov.pt: Portugal's centralized public participation platform is 100% open-source. Built using blockchain technology and integrated with secure national eID mechanisms, the government explicitly released the source code so it can be freely audited and replicated by any other nation looking to scale digital democracy.
Open Government Portal: In line with its transparency commitments, the OGP Portugal portal has its entire repository hosted publicly on GitHub, inviting global developers to contribute directly to its state infrastructure.
Enterprise Infrastructure Scaling: Major state portals (like the one-stop-shop citizen and business platforms) are built on top of robust FOSS foundations like the Liferay ecosystem.
4. Legal Frameworks: Open Standards by Law
Portugal's commitment to FOSS is not just cultural; it is institutionalized.
Law 36/2011: This specific legislation mandates that the Portuguese central government must adopt open standards in its digital and computer systems. This severely limits reliance on restrictive proprietary formats and ensures public sector documents and protocols remain accessible and vendor-neutral.
Grassroots Advocacy: Organizations like ANSOL (National Association for Open Software) have spent years working closely with public policies, promoting the research, study, and defensive deployment of FOSS alternatives in enterprise and academic settings.
The official launch of AMALIA (Automatic Multimodal Language Assistant with Artificial Intelligence / Assistente Multimodal Automático de Linguagem com Inteligência Artificial) marks an important shift in AI strategy. Rather than attempting to out-scale Silicon Valley tech giants by spending hundreds of millions on baseline compute, a university consortium led by NOVA University Lisbon (along with Instituto Superior Técnico and the Universities of Coimbra, Porto, and Minho) proved that mid-sized nations can achieve digital sovereignty efficiently via targeted model adaptation.
The comprehensive breakdown of AMALIA's underlying technical architecture, training data strategy, compute footprint, and execution specifications highlights its core design.
1. Base Architecture & Context Window Scaling
Instead of pretraining completely from scratch, the AMALIA team adopted a cost-effective pipeline by building directly upon an established multilingual open foundation model and expanding its native architectural boundaries.
Base Model: EuroLLM-9B (a 9-billion parameter open-source European foundation model) combined with parameters and data elements from the prior GlorIA project.
Parameter Count: The text model launched at ~9 Billion parameters (
AMALIA-9B), with a larger 22-billion parameter model featuring agentic processing on the roadmap for later in the year.Context Window Expansion: One of the most significant engineering enhancements made to the base model was expanding the maximum sequence length from its standard 4K tokens to 32K tokens.
RoPE Alteration: To achieve this 32K context scaling without breaking attention mechanics, the team applied Rotary Position Embedding (RoPE) scaling, aggressively shifting the base frequency theta ($\theta$) from 10,000 up to 1,000,000.
2. Specialized Data & Token Composition
The defining objective of the AMALIA project was protecting the linguistic variant and cultural nuances of European Portuguese (pt-PT), which is heavily underrepresented in commercial datasets compared to English or Brazilian Portuguese (pt-BR).
Linguistic Isolation: The team built a dedicated data cleaning and filtering pipeline to compile high-quality pt-PT resources. They extracted vast amounts of text from Arquivo.pt (the Portuguese Web Archive) and executed strict domain-filtering heuristics to systematically scrub out
.brdomains and Brazilian variants.The Token Mixture:
40 Billion Tokens: The foundational European multilingual and basic math/code mixture inherited from the initial EuroLLM architecture.
60 Billion Tokens: Added specifically to enhance the model's structural logic, expanding coverage of the code domain and long documents.
1.4 Billion Tokens: High-quality synthetically generated long-context tokens to reinforce performance on long-context retrieval tasks.
5.8 Billion Tokens: Highly curated, pristine European Portuguese text and structural documents.
3. Compute Infrastructure & Training Framework
Training an LLM requires massive computational muscle. The consortium bypassed commercial hyperscaler vendor contracts entirely by keeping data residency inside European sovereign infrastructure.
The Hardware Array:
Pretraining/Mid-training Stage: The model was trained for 80 hours using 256 NVIDIA H100 GPUs utilizing the Megatron-LM distributed pretraining framework.
Post-Training / Alignment: Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) for conversational instruction-following required 76 hours across 64 NVIDIA H100 GPUs running an AdamW optimizer with a cosine learning rate scheduler.
Sovereign Supercomputing Network: The computations were split between national and regional infrastructure, notably running natively on Portugal's local Deucalion supercomputer (located at the Minho Advanced Computing Centre) and the MareNostrum 5 supercomputer hosted at the Barcelona Supercomputing Center (BSC) in Spain.
4. Multimodality & The Open Source Ecosystem
AMALIA is not just a text model; it was deployed as a fully modular ecosystem hosted transparently under the amalia-llm organization on Hugging Face and GitHub.
Multimodal Stacks: The project spans across the standard text-based model, a specialized Vision-Language variant (
AMALIA-VL), and an integrated native speech-recognition module.Evaluation Benchmarks: To measure its regional accuracy, the project open-sourced several regional evaluation harnesses:
ALBA Benchmark: Evaluates language and specific linguistic dimensions within generative pt-PT.
P3B3 Benchmark: A multi-turn conversational evaluation tool specifically designed to test models for European vs. Brazilian variety bias.
PHEB: A benchmark based strictly on historical Portuguese High School Exams to check factual accuracy.
Licensing & Serving: The entire suite (model weights, training pipelines, and evaluation software) is released under a permissive Apache 2.0 open-source license. For deployment, the developers officially recommend serving the model using vLLM under a Python environment ($\ge 3.12$):
vllm serve amalia-llm/AMALIA-9B-0626-DPO
By keeping the budget under €7 million and adapting open architectures rather than funding a full pretraining stack from the ground up, Portugal’s AMALIA serves as a repeatable technical blueprint for smaller nations looking to safeguard their own digital and cultural sovereignty in the era of AI.
Download zone : ------------------------------------------------------------------------
👉 [Download "Python Notes for Professionals" for Free Here] (Insert your link here: https://goalkicker.com/PythonBook/PythonNotesForProfessionals.pdf)
Have you read this book yet? Let me know your favorite Python tip or trick in the comments below!
📥 Linux Magazin Ro (July 2026)
Stop wasting hours filtering through fragmented, outdated forum posts. Equip your digital toolkit with clean, verified, and reproducible technical blueprints.
👉 Download the Complete Open-Source & Tech Compilation on Gumroad Now!
Have questions about any of the configurations or setup guides included in the PDF? Drop a comment down below and let's discuss!
Simply click the link below to download the PDF, print your favorite puzzles, and start solving!
👉 [[Download 100_sudoku_puzzles.pdf Here]]
*If you enjoy these puzzles, I would love to hear your feedback
-------------------------------------------------------------------------------------------------------------------

Comments
Post a Comment