linux.do
14.1K subscribers
47.3K photos
51 videos
53 files
64.3K links
linux.do最新话题和热议话题
Download Telegram
被 uptime kuma 轰炸力()
LINUX DO - 热门话题 (RSS)

放学回来一看,我嘞个仰卧起坐的 uptime 啊()

又及,水了个 github readme:

GitHub

TethysPlex - Overview

TethysPlex has 38 repositories available. Follow their code on GitHub.

又又及,想整个大的,但手里没啥好东西喵(

11 个帖子 - 7 位参与者

阅读完整话题
【RawChat】【第12期】抽2个Claude Pro官号!
LINUX DO - 热门话题 (RSS)

奖品详情:

2个Claude Pro官号

活动时间:

开始时间:Thu, Jul 24, 2025 3:00 PM CST

截止时间:Fri, Jul 25, 2025 3:00 PM CST

参与方式:

点赞以后,在本帖下回复任意内容即可

抽奖规则:

每位用户仅允许参与一次。

使用LINUX DO 抽奖程序随机抽取中奖者。

注意事项:

本活动将在活动截止时间后关闭回帖,以确保公正性。

所有规则及抽奖结果由活动发起人和论坛管理团队最终解释。

期待您的积极参与,祝您好运!如有任何疑问,欢迎随时联系抽奖发起人。

135 个帖子 - 135 位参与者

阅读完整话题
简单粗暴解决 new api 不兼容 claude code
LINUX DO - 热门话题 (RSS)

// proxy.ts
// Single-file, no dependencies Deno proxy with optional streaming timeout logic

const TARGET = "http://127.0.0.1:5712";
const PROXY_PORT = 5713;

Deno.serve({ port: PROXY_PORT }, async (req) => {
const url = new URL(req.url);
const targetUrl = TARGET + url.pathname + url.search;

// Only inspect body for /v1/messages requests
if (url.pathname === "/v1/messages" && req.method === "POST") {
// Parse JSON body to detect streaming
let jsonBody: any;
try {
jsonBody = await req.json();
} catch {
jsonBody = {};
}
const isStream = jsonBody.stream === true;

// Forward request with reconstructed body
const forwardedReq = new Request(targetUrl, {
method: req.method,
headers: req.headers,
body: JSON.stringify(jsonBody),
});

// Handle non-streaming normally
if (!isStream) {
const resp = await fetch(forwardedReq);
return new Response(resp.body, {
status: resp.status,
headers: resp.headers,
});
}

// STREAMING: wrap with timeout logic
const upstream = await fetch(forwardedReq);
const reader = upstream.body?.getReader();
if (!reader) {
return new Response(null, { status: upstream.status, headers: upstream.headers });
}

const encoder = new TextEncoder();
let started = false;
let aborted = false;
let timerId: number | null = null;
let controllerRef: ReadableStreamDefaultController<Uint8Array>;

const resetTimer = () => {
if (timerId !== null) clearTimeout(timerId);
timerId = setTimeout(() => {
if (!aborted) {
controllerRef.enqueue(encoder.encode("event: message_stop\ndata: {}\n\n"));
controllerRef.close();
reader.cancel();
aborted = true;
}
}, 3000);
};

const stream = new ReadableStream<Uint8Array>({
start(controller) {
controllerRef = controller;
const pump = async () => {
try {
const { done, value } = await reader.read();
if (done || aborted) {
if (!aborted) controller.close();
return;
}
const chunk = value!;
const text = new TextDecoder().decode(chunk);
if (!started && text.includes("event: message_start")) {
started = true;
resetTimer();
}
if (started && text.includes("content_block_delta")) {
resetTimer();
}
controller.enqueue(chunk);
pump();
} catch {
if (!aborted) controller.close();
}
};
pump();
},
cancel() {
reader.cancel();
aborted = true;
if (timerId !== null) clearTimeout(timerId);
}
});

const headers = new Headers(upstream.headers);
headers.set("connection", "keep-alive");
headers.set("cache-control", "no-cache");
headers.set("content-type", "text/event-stream");

return new Response(stream, {
status: upstream.status,
headers,
});
}

// Other paths or methods: simple proxy
const forwardedReq = new Request(targetUrl, {
method: req.method,
headers: req.headers,
body: ["GET", "HEAD"].includes(req.method) ? undefined : req.body,
});

const resp = await fetch(forwardedReq);
return new Response(resp.body, {
status: resp.status,
headers: resp.headers,
});
});

console.log(`Proxy running on http://localhost:${PROXY_PORT} → ${TARGET}`);


遇事不决上 wrapper, 一层不够再加一层。

给 TARGET 改为你的 new api 地址,然后运行后在 5713 端口访问即可。

略微牺牲速度换来了不修改代码解决 anthropic /v1/messages 流式不会返回结束 · Issue #1428 · QuantumNous/new-api · GitHub

17 个帖子 - 16 位参与者

阅读完整话题
临时屏蔽LinuxDO新增顶栏和底栏的油猴脚本
LINUX DO - 热门话题 (RSS)

// ==UserScript==
// @name 屏蔽 linux.do 指定区块 并 修正顶栏位置
// @namespace
// @version 1.2
// @description 在 linux.do 页面中隐藏顶部子系统菜单和底部自定义页脚,并修正顶栏位置
// @author Steve5wutongyu6
// @match *://linux.do/*
// @run-at document-end
// @grant none
// ==/UserScript==

(function() {
'use strict';

/** 删除所有匹配的元素 */
function removeElements(selector) {
document.querySelectorAll(selector).forEach(el => el.remove());
}

/** 注入自定义样式覆盖 */
function injectStyle(css) {
const style = document.createElement('style');
style.innerText = css;
document.head.appendChild(style);
}

/** 初始执行:移除目标区块并修正样式 */
function init() {
// 顶部子系统及其容器
removeElements('.above-site-header-outlet.header-submenus');
// 底部自定义页脚
removeElements('.below-footer-outlet.custom-footer');
// 修正顶栏位置:确保顶栏贴顶
injectStyle(`.d-header-wrap { top: 0 !important; }`);
}

// 初次调用
init();

// 监听 DOM 变动,动态移除新插入的目标区块并确保样式
const observer = new MutationObserver(() => {
init();
});
observer.observe(document.body, { childList: true, subtree: true });

})();


26 个帖子 - 21 位参与者

阅读完整话题
1
不能回复就把点赞当洛阳铲是吧
LINUX DO - 热门话题 (RSS)





社区还是太友善了 发了5个月都不忘记给我点赞 让我凑个徽章

好奇这也没有关键词 他们到底是怎么搜索到的

真通过DeepSeek就能搜到我这个话题的话 概率......

13 个帖子 - 9 位参与者

阅读完整话题
如何约束大模型严格输出指定内容?引导解码器 Guided Decoder 原理讲解 & 实战演示
LINUX DO - 热门话题 (RSS)



前言
相信大家在开发 AI Agent 的时候一定遇到过这样的情况:我希望让大模型严格只输出 yes 或者 no,这样我就可以写一个这样的程序来决定 Agent 后续的走向了:

if result == 'yes':
# 执行下一步
execute_next_step()
elif result == 'no':
# 执行退出操作
execute_exit()


当然,有时候我们还会遇到更加复杂的需求,比如,想要大模型严格按照一个规范返回 json,甚至是某种更加抽象的形式语言。比如锦恢制作的一个 i18n 翻译插件中,就希望大模型严格按照一个数据结构返回指定的 json 内容,这样,我就可以通过剩下的程序来把这部分内容同步到软件的其他地方去了。


这时候,看过锦恢前几篇教程的你,一定会兴奋地说:“这还不简单,用 prompt 大法不就解决了?” 然后你非常自信地写出了如下的演示代码:

prompt = """
你是一个聪明的 Agent,我会在下面询问你几个事实性的问题

你只需要回答 yes 或者 no 就行

请问初音未来是真实的人类吗?
"""
outputs = llm.generate(prompts=prompt)

此处使用了 Qwen2.5-3B-Instruct 这个模型,它的回答是:

'不 是\n好的,我知道了 请继续 提供帮助\n\n接下来我'

可以看到,结果是对的,初音未来确实不是真实的人类,但是我希望它返回的是 yes 或...

View original post
Edgeone不需要兑换码了,快来注册!
LINUX DO - 热门话题 (RSS)

Tencent EdgeOne

Speed Test to Grab More EdgeOneFree Plans

EdgeOne Free plan campaign upgraded! No redemption codes needed/Instant activation/Claim multiple plans. Test global edge node speed & share results to get free plans!

62 个帖子 - 32 位参与者

阅读完整话题
vercel ai gateway beta free for all models
LINUX DO - 热门话题 (RSS)

vercel ai gateway beta free for all models

no limit

no cost

every one

by vercel ai sdk(beta)



33 个帖子 - 28 位参与者

阅读完整话题
[破事水]qwen3-coder使用者的钱包有救了
LINUX DO - 热门话题 (RSS)

qwen3-coder上线后阿里云百炼的使用量猛增, 不少佬友反馈出现了大额账单

守护好钱包,慎用 qwen3-coder-plus 开发调优


[image]
使用 cc + 百炼 qwen3-coder-plus 的小伙伴请注意控制上下文大小,它是阶梯计价模式,一旦到 256K + 价格非常高
账号已透,已老实
========================
https://mp.weixin.qq.com/s/yZLXeQQRLLGi_vH1dhibzQ
有小伙伴开发了魔搭配置插件 开薅!


问题主要有以下3个:

— 百炼的qwen3-coder在长上下文场景单价很高, 上下文256k以上的输出价格高达200元每M
— 百炼的上下文缓存基本不可用, 完全相同的请求也无法命中缓存
— qwen code这个cli工具默认会将当前文件夹下的文件树(即递归包含所有文件, 最多200个)发送给模型

— 针对问题1, 阿里对长上下文价格进行了降价(Qwen3-Coder 降价了).
— 针对问题2, 阿里qwen团队的负责人确认bug正在修复中.


— 针对问题3, 尽量只在必要范围内(比如项目根目录)启动qwen code, 不要在linux用户根目录等文件非常多的地方启动qwen code(这会消耗大量token!)

个人比较看好qwen家族的模型, 希望大家用得开心

22 个帖子 - 18 位参与者

阅读完整话题
再见,poolhub 和 Augment Proxy
LINUX DO - 热门话题 (RSS)

感谢两位佬的付出,白嫖了好长一段时间了。这段时间里,Augment 自由!

预祝 @j3n5en 佬的孩子一切顺利,平平安安得以见到这世间万般风景。

https://augment.caicode.org/

https://poolhub.me/



温馨提示:如果你要从💩切回Augment 原版插件,记得退出登录


cmd(ctrl)shift​p 搜索 augment sign out


35 个帖子 - 33 位参与者

阅读完整话题