AI知识库 @ai521
313 subscribers
21.7K photos
42 videos
19 files
833 links
@ai521 专注分享最实用的AI内容

🤖 AI教程(新手到进阶)
🧠 AI知识科普(大模型 / 提示词 / 自动化)
📰 AI资讯更新(每日最新AI动态)
📚 AI实战技巧(写作 / 绘画 / 编程 / 赚钱)
🔧 最新AI工具推荐

每天更新AI干货
长期做一个真正有价值的AI频道
Download Telegram
API的力量

一篇来自科技博客的文章聚焦于API(应用程序接口)在人工智能交互中的核心作用。文章指出,API是实现AI系统与外部世界通信的关键桥梁,它使得开发者能够高效、标准化地调用AI能力,从而支撑起各类智能应用的运行。然而,尽管API在AI架构中扮演着不可或缺的角色,其贡献常常被低估和忽视,堪称界面背后的“无名英雄”。由于本次获取的
Mozilla 开源 LLM 控制平面 Otari,统一管理基础设施

据 Mozilla 官方介绍,该公司正式推出 Otari——一个开源的大型语言模型(LLM)控制平面。Otari 旨在通过单一控制层简化 LLM 基础设施的管理,主要功能包括跨多个提供商的请求路由、使用量追踪与预算控制、API 密钥和工作区治理、云端及本地灵活部署、自动故障转移以保障可靠性,以及内置工具将模型转化为代理就绪应用。该平台降低了多模型调用的复杂度,帮助开发者控制成本、提升系统可观测性与可靠性,并支持社区参与定制。作为开源项目,Otari 进一步丰富了 Mozilla 在 AI 领域的布局,为生产级 LLM 应用提供了可信任的基础设施选择。 #Mozilla #Otari #开源 #LLM #AI #控制平面 #基础设施 #开发者
Anker Soundcore Sleep A20 睡眠耳塞降至历史最低价 99.99 美元

Anker 旗下 Soundcore 系列专为睡眠设计的降噪耳塞 Sleep A20 目前迎来新低价。该耳塞可有效阻隔环境噪音,帮助用户更快入睡并减少夜间惊醒。即日起在 Best Buy 和 Target 平台,这款产品售价降至 99.99 美元,较原价直降 80 美元,创下上市以来的最低纪录。对于饱受噪音干扰的睡眠困难者来说,这是一次性价比极高的入手机会。耳塞本体采用贴合耳道的舒适设计,并支持蓝牙连接播放助眠音频,兼顾被动降噪与主动功能。降价幅度接近五折,预计将持续至库存售罄。 #Anker #Soundcore #SleepA20 #睡眠耳塞 #降噪 #历史低价 #科技产品 #BestBuy #Target
Build an AI Audiobook Narrator with Telnyx AI Inference, TTS, and Cloud Storage

Turning a manuscript into a narrated audiobook traditionally means hiring a voice actor, booking studio time, and accepting that revisions cost hours of re-recording. This walkthrough builds a Flask app that takes raw text, uses AI Inference to chunk it into chapters with pacing and emotion cues, narrates each chapter with text-to-speech, and stores the resulting MP3s in Telnyx Cloud Storage with presigned URLs for playback. The canonical code example lives in the Telnyx code examples repo: A single-file Flask app with five endpoints: The pipeline runs in three stages. AI Inference splits the submitted text into chapters and adds narration cues (tone, pacing, emphasis). Text-to-speech renders each chapter as an MP3 using a consistent voice. Cloud Storage holds the final audio and returns a time-limite
d presigned GET URL for each chapter so callers can stream the result without handling long-lived credentials. The audiobook narrator exercises three Telnyx AI products in a single request flow — AI Inference, TTS, and Cloud Storage — and returns a tangible artifact (an actual MP3 file) instead of a text completion. That makes it a useful reference for anyone building content-generation pipelines where the output is media, not text. Developers use this pattern as the foundation for: telnyx_products: [AI Inference, TTS, Cloud Storage] Telnyx AI Inference exposes an OpenAI-compatible API for chat completions. Telnyx TTS generates speech from text via POST /v2/ai/generate . Telnyx Cloud Storage is S3-compatible, so the AWS SDK (boto3) talks to it directly — the Telnyx API key is used as both the access key and the secret key, and the endpoint host is region-scoped ( ). POST /books/narrate | v +----------------------+ | AI Inference | chunks text into chapters, | /v2/ai/chat/ | adds tone + pacing cues | completions | +----------+-----------+ | v +----------------------+ | TTS Generate | renders each chapter as MP3 | /v2/ai/generate | with a consistent voice +----------+-----------+ | v +----------------------+ | Cloud Storage (S3) | PutObject per chapter, | boto3 put_object | presigned GET URL returned +----------+-----------+ | +---> JSON response with storage_urls[] The Code The full app is 242 lines in a single . The key pieces: Configuration and storage client. The Telnyx API key is loaded from the environment and used for both the REST API (Inference, TTS) and the S3 client (Cloud Storage). The S3 client is pointed at the region-scoped Telnyx endpoint with s3v4 signing: import os, boto3 from import Config TELNYX_API_KEY = ("TELNYX_API_KEY") REGION = ("TELNYX_STORAGE_REGION", "us-central-1") s3 = ( "s3", aws_access_key_id=TELNYX_API_KEY, aws_secret_access_key=TELNYX_API_KEY, config=Config(signature_version="s3v4"), ) AI Inference call. A system prompt instructs the model to break the text into chapters and return a JSON array with chapter_number , chapter_title , narration_text , tone , and pacing fields. The response is parsed as JSON, with a fallback to paragraph splitting if the model returns malformed JSON: def inference(messages, max_tokens=4000): resp = (f"{API}/ai/chat/completions", headers=HEADERS, json={ "model": AI_MODEL, "messages": messages, "max_tokens": max_tokens, "temperature": 0.3 }, timeout=60) return ()["choices"][0]["message"]["content"] TTS generation. Each chapter's narration text is sent to POST /v2/ai/generate with the chosen voice and output_format: mp3 . The response body is the raw MP3 bytes: def tts_generate(text, voice=None): resp = (f"{API}/ai/generate", headers=HEADERS, json={ "text": text, "output_format": "mp3" }, timeout=60) return Upload to Cloud Storage. Each chapter MP3 is uploaded with put_object , then a presigned GET URL valid for one hour is returned so the caller can stream the audio without exposing long-lived credentials: def upload_to_storage(bucket, key, data, content_type="audio/mpeg"): s3.put_object(Bucket=bucket, Key=key, Body=data, ContentType=content_type) return s3.generate_presigned_url( "get_object", Params={"Bucket": bucket, "Key": key}, ExpiresIn=3600 ) The narrate endpoint. Wires the three stages together, with graceful fallback if the AI chunking returns malformed JSON (splits the text by paragraphs instead): @ ("/books/narrate", methods=["POST"]) data = request.get_json()
or {} if not data: return jsonify({"error": "invalid request body"}), 400 title = ("title", "Untitled") text = ("text", "") voice = ("voice", DEFAULT_VOICE) if not text: return jsonify({"error": "Provide 'text' to narrate"}), 400 book_id = f"book-{uuid.uuid4().hex[:8]}" # Step 1: AI chunks text into chapters with narration cues try: chunking_result = inference([ {"role": "system", "content": "You are an audiobook production assistant..."}, {"role": "user", "content": text[:15000]} except : # Fallback: split by paragraphs paragraphs = [ () for p in ("\n\n") if ()] chapters = [{ "chapter_title": f"Chapter {i + 1}", "tone": "warm", "pacing": "moderate" } for i, chunk in enumerate(paragraphs)] # Step 2 + 3: TTS per chapter → Cloud Storage for chapter in chapters: audio = tts_generate(chapter["narration_text"], voice=voice) key = f"{book_id}/chapter-{chapter['chapter_number']:02d}.mp3" url = upload_to_storage(BUCKET_NAME, key, audio) books[book_id]["storage_urls"].append(url) return jsonify({ "book_id": book_id, "title": title, "status": "complete", "chapters": len(books[book_id]["chapters"]), "storage_urls": books[book_id]["storage_urls"] }), 201 Run It git clone cd telnyx-code-examples/ai-audiobook-narrator-python cp . .env # add TELNYX_API_KEY, optionally tune AI_MODEL, TTS_MODEL, BUCKET_NAME pip install -r python The server starts on . Create a bucket named audiobooks in the Telnyx Portal (or set BUCKET_NAME to an existing bucket) and submit a chunk of text: curl -X POST \ -H "Content-Type: application/json" \ -d '{ "title": "The Future of Infrastructure", "text": "Chapter 1: The shift from cloud-edge to carrier-edge compute is changing where latency-sensitive workloads run...", "voice": "nova" }' The response includes a book_id and a list of presigned storage_urls , one per chapter: { "title": "The Future of Infrastructure", "status": "complete", "chapters": 3, "voice": "nova", " " " ] } Open any storage_url in a browser or stream it from a client to hear the narrated chapter. The app exposes five narrator voices out of the box: List them at any time: curl Pass any voice identifier in the voice field of the /books/narrate request. This example uses an in-memory dict for book metadata, which is fine for local testing but loses state on restart. For production: Do I need an existing Cloud Storage bucket before running this? Yes. Create a bucket in the Telnyx Portal and set BUCKET_NAME in .env to match. The app does not create the bucket for you. What happens if the AI returns malformed JSON for the chapter split? The app catches and falls back to splitting the text by double-newline paragraphs. Each paragraph becomes a chapter with default tone: warm and pacing: moderate . Narration still completes — you just lose the AI's tone and pacing direction. Which AI model is used by default? The default is moonshotai/Kimi-K2.6 (set in . and overridable via AI_MODEL ). Any model available on Telnyx AI Inference works — see the models list for options. Can I use a different TTS voice per chapter? Not in this example — the voice is set once per request and used for every chapter. To vary voices per chapter, extend the narrate_book loop to read chapter["voice"] from the AI's response and pass it to tts_generate . How long do the presigned URLs last? One hour ( ExpiresIn=3600 ). The stored MP3s persist in the bucket; only the URL expires. Generate a fresh presigned URL with s3.generate_presigned_url whenever you need a new one. Is the
uploaded audio public? No. The bucket is private by default. Only the presigned URL grants time-limited read access. To make audio publicly accessible (e.g., for public-domain audiobooks), set a public read policy on the bucket in the Telnyx Portal. What is the maximum input text length? The chunking step truncates input to 15,000 characters per request. For longer manuscripts, split the source into sections on the client and submit each as a separate /books/narrate request, then stitch the resulting storage_urls together. Can I narrate in languages other than English? Yes — Telnyx TTS supports multiple languages. The AI Inference prompt is in English, but you can edit the system message in to chunk in another language, and pass a language-appropriate voice to tts_generate .
AI数据中心隐含水耗达官方数据数十倍 韩国巨型项目风险高

据《华尔街日报》报道,美国劳伦斯伯克利国家实验室最新报告指出,AI数据中心的“间接水耗”(发电过程中蒸发的水)平均是服务器直接冷却用水的12倍,但多数科技巨头仅披露直接用水。谷歌2023年直接用水虽达109亿加仑,但研究估算其隐含水耗至少为直接用水的3倍;Meta 2024年间接水耗超过直接用水20倍,达190亿加仑,却未制定具体减排措施。此外,约三分之二的新建数据中心位于菲尼克斯等长期缺水地区,非营利组织警告当地水需求到2031年将超城市总水量的20%。Nvidia虽研发无水冷却系统,但全球数据中心改造代价高昂。韩国正推进的“三大巨型项目”大规模兴建AI数据中心,因缺乏水资源对策被业界认为存在严重隐患。 #AI #数据中心 #水资源 #环境 #韩国 #科技新闻 #隐含水耗
AI内容与社会契约

一位个人博客作者在其网站发文,批评当前用AI生成内容或摘要阅读的潮流。他指出,利用AI快速写博文或让AI消化文章虽能带来虚假的“高产感”,但本质上如“信息垃圾食品”,无法满足真正的交流与求知。作者强调,他写博客是为了分享对宇宙的惊叹、传递知识,而非追求数量;读者阅读也应追求充实感而非效率。他担忧AI介入创作与消费会廉价化人与人之间的真实连接,并认为互联网的未来应回归由人类策展的小众社区,而非AI主导的流水线内容生产。文章引发对技术时代内容价值与社会契约的反思。 #AI #内容创作 #博客 #社会契约 #伪生产力 #信息消费 #互联网趋势 #技术伦理
AI智能体系统缺乏可见性?开发者用LangSmith实现全流程追踪

开发者Hugo Santana为其构建的多智能体系统引入了可观测性平台LangSmith。此前,他搭建了一个由6个智能体组成的研究系统,用于追踪AI应用案例、工具和供应商,并包含翻译和内容匹配等功能。随着系统扩展至更多智能体,虽然能看到最终输出和日志,但无法清晰了解每个智能体的运行细节,如token消耗、任务失败原因和耗时。LangSmith提供了完整的追踪功能,将智能体活动转化为可搜索的运行记录,包含输入输出、时长、状态、成本及错误信息。这一集成使他能够监控效率、可靠性,并为多智能体产品的优化奠定基础。LangSmith框架无关的特性使其能无缝对接自定义系统,且开源的API设计便于AI编码工具辅助集成。 #AI #智能体 #可观测性 #LangSmith #多智能体系统 #技术工具