Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Qwen2.5-Coder, l'AI che sviluppa software e funziona anche in locale

Qwen2.5-Coder, l'AI che sviluppa software e funziona anche in locale

Qwen2.5-Coder è un modello generativo aperto sviluppato da Alibaba per il coding, che si distingue per precisione e versatilità. Disponibile in sei dimensioni, supporta oltre 40 linguaggi di programmazione e può essere eseguito anche in locale, rendendolo ideale per sviluppatori con esigenze diverse.

Ci siamo più volte soffermati sulle abilità dei chatbot nello sviluppo software. Alcuni modelli generativi sono decisamente migliori rispetto agli altri nel produrre codice di programmazione, nella risoluzione dei bug e nell’ottimizzazione delle routine già sviluppate. Nella comunità open source sta facendo discutere molto il nuovo Qwen2.5-Coder, un Large Language Model (LLM) sviluppato da Alibaba e distribuito sotto licenza Apache 2.0.

I primi test hanno messo in evidenza prestazioni sorprendenti. Gli apprezzati benchmark Aider di Paul Gauthier indicano che Qwen2.5-Coder-32B si colloca tra OpenAI GPT-4o e Anthropic Claude 3.5 Haiku, raggiungendo il 74% di accuratezza.

Trattandosi di un modello aperto, è possibile fare inferenza anche in locale, svincolandosi completamente da qualunque piattaforma cloud.

Cos’è e come funziona il modello Qwen2.5-Coder

Qwen2.5-Coder nasce come LLM specializzato nella programmazione. Dimostra solide e complete competenze nella generazione di codice, ma anche un’eccellente abilità generale e matematica. Il modello eccelle in vari benchmark relativi allo sviluppo di codice ed è altamente competitivo in tutte le attività svolte dai developer.

La capacità di prevedere correttamente input e output, supera i risultati dei modelli già noti. Così, Qwen2.5-Coder è destinato ad eccellere negli ambienti di programmazione complessi.

La serie Qwen2.5-Coder include sei modelli di dimensioni differenti (0.5B, 1.5B, 3B, 7B, 14B e 32B), per supportare un’ampia varietà di ambienti di sviluppo, dalla sperimentazione accademica a progetti avanzati su larga scala. Gli sviluppatori possono così scegliere il modello più adatto alle loro risorse e agli obiettivi perseguiti, potendo beneficiare di un livello di flessibilità senza precedenti.

Ogni modello è disponibile sia nella versione Base che Instruct: la versione Base offre un’ottima piattaforma per ulteriori personalizzazioni; la versione Instruct è ottimizzata per rispondere efficacemente alle interazioni e alle richieste di codifica.

Con il supporto per più di 40 linguaggi di programmazione, il modello rende la transizione tra linguaggi più agevole e accessibile, aiutando i programmatori a ridurre il tempo di apprendimento e migliorare la comprensione di nuovi linguaggi.

Installazione in locale: Qwen2.5-Coder 32B funziona senza problemi su un MacBook Pro M2 con 64 GB di RAM

Un aspetto particolarmente interessante di Qwen2.5-Coder è che il modello, anche nella versione più “ricca” da 32 miliardi di parametri (32B), può essere fatto funzionare in locale.

Simon Willison lo ha provato su un sistema MacBook Pro M2 con 64 GB di RAM ottenendo risultati assolutamente soddisfacenti, sia con una versione quantizzata del modello in esecuzione con Ollama, sia servendosi del framework MLX per Apple Silicon.

La versione quantizzata di un modello per Ollama è una versione ottimizzata del LLM in cui i parametri sono ridotti in fatto di precisione, generalmente da 16 bit o 32 bit a 8 bit o meno. Questo approccio permette di ridurre la dimensione del modello e il consumo di memoria, rendendo il modello più leggero e veloce da eseguire su hardware con risorse limitate, come CPU o GPU meno potenti.

Per scaricare Qwen2.5-Coder in locale con Ollama basta digitare quanto segue:

ollama pull qwen2.5-coder:32b

Willison ha quindi posto due richieste molto precise in fatto di programmazione ottenendo risultati al di sopra delle aspettative. Questa la richiesta avanzata al modello attraverso Ollama:

llm install llm-ollama
llm models # Confirming the new model is present
llm -m qwen2.5-coder:32b 'python function that takes URL to a CSV file and path to a SQLite database, fetches the CSV with the standard library, creates a table with the right columns and inserts the data'

E questa, invece, la richiesta trasferita al LLM Qwen2.5-Coder utilizzando MLX:

uv run --with mlx-lm \
mlx_lm.generate \
--model mlx-community/Qwen2.5-Coder-32B-Instruct-8bit \
--max-tokens 4000 \
--prompt 'write me a python function that renders a mandelbrot fractal as wide as the current terminal'

Le evoluzioni future

Gli sviluppatori di Alibaba precisano di essere già al lavoro su nuove versioni ancora più evolute del modello. In particolare, stanno esplorando modelli di ragionamento avanzati focalizzati sul codice. Sappiamo infatti che l’introduzione delle abilità di reasoning, sbloccabili attivando algoritmi che suddividono i problemi in più passaggi, è un po’ la nuova frontiera per tutte le realtà impegnate nello sviluppo di soluzioni AI.

Da parte sua, i portavoce di Alibaba spiegano che l’idea è quella di fornire, in futuro, strumenti sempre più potenti per supportare gli sviluppatori in scenari applicativi ancora più ambiziosi.

Credit immagine in apertura: iStock.com – Userba011d64_201

Ti consigliamo anche

Link copiato negli appunti