neko
deepin
2024-03-15 02:42 Ecological co-builder
这个好耍
Reply Like 0 View the author
这个好耍
可以通过社区投递系统 快捷发布到应用商店,其他小伙伴就能直接通过应用商店一站下载安装啦
可以通过社区投递系统 快捷发布到应用商店,其他小伙伴就能直接通过应用商店一站下载安装啦
😄 那得封装成deb格式吧
😄 那得封装成deb格式吧
可以通过生态赋能 | 一站式应用迁移平台 一键转换为deb安装包
牛啊,原来还可以这么玩儿
可以通过生态赋能 | 一站式应用迁移平台 一键转换为deb安装包
下午试试。
牛啊!!
跟uos ai的结合不错,可以搞一个插件默认提供
很实用的教程
Popular Ranking
ChangePopular Events
More
在AI领域,模型推理的环境配置和安装过程常常让人头疼。如果你也有这样的困扰,那么今天我要为你介绍的这个工具——llamafile,将会是你的福音。
1. llamafile到底是什么?
llamafile是一种可在你自己的电脑上运行的可执行大型语言模型(LLM)。它包含了给定的开放LLM的权重,以及在你的电脑上运行该模型所需的一切。让人惊喜的是,你无需进行任何安装或配置。
2. llamafile如何实现这一切?
这一切都得益于llama.cpp与Cosmopolitan Libc的结合。这种结合提供了一些强大的功能:
3. llamafile支持哪些操作系统和CPU?
llamafile支持Linux 2.6.18+、Darwin (macOS) 23.1.0+、Windows 8+、Free BSD 13+、NetBSD 9.2+、OpenBSD 7+等操作系统。在CPU方面,支持AMD64和ARM64两种微处理器。
4. llamafile对GPU的支持如何?
llamafile支持Apple Metal、NVIDIA和AMD三种类型的GPU。在MacOS ARM64上,可以通过编译一个小模块来支持GPU。NVIDIA和AMD显卡的所有者需要传递特定参数来启用GPU。
5. 你也可以创建自己的llamafiles!
有了这个项目包含的工具,你可以创建自己的llamafiles,使用任何你想要的兼容模型权重。然后,你可以将这些llamafiles分发给其他人,他们可以轻松地使用它们,无论他们使用的是什么类型的计算机。
llamafile无疑是一个强大的工具,它使得模型推理变得更加便捷,无需安装或配置复杂的环境。如果你还在为模型推理的环境配置而烦恼,那么为何不试试llamafile呢?具体可以参考这个教程:利用llamafile构造傻瓜式,支持多平台启动的大模型 - 知乎 (zhihu.com)
6. 如何在deepin上面使用?
打开终端,运行
sh ./xxxx.llamafile
7. 如何在windows上面使用?
改后缀为.exe,双击打开即可。
8. 如何使用gpu运行而不是cpu?
需要你:装好nvidia/amd驱动,对应nvidia,还应该装了cuda,然后在运行时加上
-ngl 99999
即可,这个代表将99999层(实际也就几百上千层)网络都搬到GPU,如果你显存不够,可以适当降低这个数值,比如99?999?综合来看,对于Deepin:
sh ./xxxx.llamafile -ngl 99999
对于Windows:./xxx.lamafile.exe -ngl 9999
9. 获取地址
百度网盘链接:https://pan.baidu.com/s/14cv7McPa1XpXBNKy914HyQ?pwd=msjn
提取码:msjn
123云盘链接(注:后缀.exe可以忽略,因为llamafile是跨平台的,可以同时在linux/windows/mac/bsd上面运行)
https://www.123pan.com/s/oEqDVv-IP4o.html提取码:8MCi
10. 使用截图
11 接入其他客户端?
推荐这个:ChatGPTNextWeb/ChatGPT-Next-Web: A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。 (github.com)
安装后再设置,模型服务商选择OpenAI, 接口地址换成
http://127.0.0.1:8080
12 接入UOS-AI(不推荐普通人尝试)?
先启动llamafile
再安装nginx
sudo apt install nginx
利用openssl自签名ssl证书,有效期10年。
openssl req -newkey rsa:2048 -x509 -nodes -keyout localhost.key -new -out localhost.crt -subj /CN=Hostname -reqexts SAN -extensions SAN -config <(cat /usr/lib/ssl/openssl.cnf \ <(printf '[SAN]\nsubjectAltName=DNS:hostname,IP:127.0.0.1')) -sha256 -days 3650
在nginx配置目录,创建证书目录,将刚刚的证书移过去。
编辑nginx默认网站配置文件,
sudo vim /etc/nginx/sites-enabled/default
配置如下:## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # https://www.nginx.com/resources/wiki/start/ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # https://wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or Wordpress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl_certificate cert/localhost.crt; ssl_certificate_key cert/localhost.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; # server_name _; server_name api.openai.com; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
重启nginx
修改本机host,将本机ip: 127.0.0.1映射到刚刚配置的
api.openai.com
,修改方法:sudo vim /etc/hosts
在任意行增加一行127.0.0.1 api.openai.com
然后按照之前的帖子:UOS AI 打开GPT支持方法-论坛-深度科技 (deepin.org) ,让UOS-AI进入英语环境,这样才能添加chatgpt设置。
添加配置

添加成功(电脑配置差的可能要多试几次)

添加成功
注意:目前选择gpt3.5/gpt4在uosAI里面貌似不支持流式传输,也就是没办法一个字一个字吞吐,导致要等待较长时间,等所有字都预测好了才回返回,体验较差,而其他api比如讯飞星火是支持流的,所以建议还是用llamafile自带的那个网页聊天窗吧。