能力标签
可用事为常用的常用器
🛠
AI工具

可用事为常用的常用器

基于 Elixir · 开源免费,本地部署,数据完全自主可控
英文名:req_llm
⭐ 520 Stars 🍴 151 Forks 💻 Elixir 📄 Apache-2.0 🏷 AI 7.5分
7.5AI 综合评分
tag1tag2tag3
✦ AI Skill Hub 推荐

AI Skill Hub 推荐使用:可用事为常用的常用器 是一款优质的AI工具。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。

📚 深度解析

可用事为常用的常用器 是一款基于 Elixir 的开源工具,在 GitHub 上收获 1k+ Star,是tag1、tag2、tag3领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
可用事为常用的常用器 依赖 Elixir 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Elixir 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 可用事为常用的常用器 的版本更新,及时通知重要功能变化。

📋 工具概览

可用事为常用的常用器一个学为常用的常用器。常用的常用器一个学为常用的常用器。

可用事为常用的常用器 是一款基于 Elixir 开发的开源工具,专注于 tag1、tag2、tag3 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 520
开发语言
Elixir
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
Apache-2.0
AI 综合评分
7.5 分
工具类型
AI工具
Forks
151

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

可用事为常用的常用器一个学为常用的常用器。常用的常用器一个学为常用的常用器。

可用事为常用的常用器 是一款基于 Elixir 开发的开源工具,专注于 tag1、tag2、tag3 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 克隆仓库
git clone https://github.com/agentjido/req_llm
cd req_llm

# 查看安装说明
cat README.md

# 按 README 完成环境依赖安装后即可使用
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 查看帮助
req_llm --help

# 基本运行
req_llm [options] <input>

# 详细使用说明请查阅文档
# https://github.com/agentjido/req_llm
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# req_llm 配置说明
# 查看配置选项
req_llm --config-example > config.yml

# 常见配置项
# output_dir: ./output
# log_level: info
# workers: 4

# 环境变量(覆盖配置文件)
export REQ_LLM_CONFIG="/path/to/config.yml"
📑 README 深度解析 真实文档 完整度 82/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

ReqLLM

Hex.pm Hex Docs CI License Website Ecosystem Discord

Join the community! Come chat about building AI tools with Elixir and coding Elixir with LLMs in The Swarm: Elixir AI Collective Discord server.

A Req- and Finch-backed package to call LLM APIs that standardizes requests and responses across providers.

Features

  • Provider-agnostic model registry
  • 21 implemented providers / 1,205 models sourced from LLMDB via the llm_db dependency
  • Text, embedding, image generation, speech, transcription, rerank and OCR operation metadata
  • Cost, context length, modality, capability and deprecation metadata included
  • Canonical data model
  • Typed Context, Message, ContentPart, Tool, StreamChunk, Response, Usage
  • Multi-modal content parts (text, image URL, tool call, binary)
  • All structs implement Jason.Encoder for simple persistence / inspection
  • Unified client surface
  • High-level Vercel-AI style helpers (generate_text/3, stream_text/3, generate_object/4, bang variants)
  • Req-backed request/response calls and Finch-backed streaming behind the same provider abstraction
  • Advanced Req request customization available for non-streaming use cases
  • Structured object generation
  • generate_object/4 renders JSON-compatible Elixir maps validated by a NimbleOptions-compiled schema
  • Zero-copy mapping to provider JSON-schema / function-calling endpoints
  • OpenAI native structured outputs with three modes (:auto (default), :json_schema, :tool_strict)
  • Provider-specific capabilities
  • Anthropic web search for real-time content access (via provider_options: [web_search: %{max_uses: 5}])
  • Extended thinking/reasoning for supported models
  • Prompt caching for cost optimization
  • All provider-specific options documented in provider guides
  • Embedding generation
  • Single or batch embeddings via Embedding.generate/3 (Not all providers support this)
  • Automatic dimension / encoding validation and usage accounting
  • Production-grade streaming
  • stream_text/3 returns a StreamResponse with both real-time tokens and async metadata
  • Finch-based streaming with automatic connection pooling and configurable checkout timeouts
  • OpenAI Responses models can opt into WebSocket mode with provider_options: [openai_stream_transport: :websocket]
  • Concurrent metadata collection (usage, finish_reason) without blocking token flow
  • Works uniformly across providers with internal SSE / chunked-response adaptation
  • Experimental OpenAI realtime sessions
  • ReqLLM.OpenAI.Realtime exposes a low-level WebSocket session API for Realtime models
  • Designed for explicit event-driven workflows that do not map cleanly to stream_text/3
  • Usage & cost tracking
  • response.usage exposes normalized usage and best-effort USD cost from model metadata and provider response data
  • Schema-driven option validation
  • All public APIs validate options with NimbleOptions; errors are raised as ReqLLM.Error.Invalid.* (Splode)
  • Automatic parameter translation & codecs
  • Provider DSL translates canonical options (e.g. max_tokens -> max_completion_tokens for o1 & o3) to provider-specific names
  • Built-in OpenAI-style encoding/decoding with provider callback overrides for custom formats
  • Flexible model specification
  • Accepts "provider:model", tuples, %LLMDB.Model{} structs, and plain-map model specs
  • ReqLLM.model!/1 is the recommended way to validate and normalize full model specs
  • Secure, layered key management (ReqLLM.Keys)
  • Per-request override → application config → env vars / .env files
  • OAuth bearer auth for supported providers
  • Direct access_token support for OpenAI and Anthropic
  • OpenAI can load and refresh openai-codex credentials from oauth.json / auth.json
  • openai_codex:* targets the ChatGPT Codex backend with OAuth-only auth and automatic account-id extraction
  • Extensive reliability tooling
  • Fixture-backed test matrix (LiveFixture) supports cached, live, or provider-filtered runs
  • Dialyzer, Credo strict rules, and no-comment enforcement keep code quality high

Install dependencies

mix deps.get

Installation

Manual Installation

Add req_llm to your list of dependencies in mix.exs:

def deps do
  [
    {:req_llm, "~> 1.6"}
  ]
end

Then run:

mix deps.get

Quick Start

```elixir

Access usage metadata after streaming

usage = ReqLLM.StreamResponse.usage(response) ```

Usage Cost Tracking

Every response includes detailed usage and best-effort cost information calculated from normalized provider usage data plus model pricing metadata:

```elixir {:ok, response} = ReqLLM.generate_text("anthropic:claude-haiku-4-5", "Hello")

response.usage #=> %{

Tool & Image Usage

When using web search or generating images, additional usage metadata is available:

```elixir

Web search usage (Anthropic, OpenAI, xAI, Google)

{:ok, response} = ReqLLM.generate_text(model, prompt, provider_options: [web_search: %{max_uses: 5}])

response.usage.tool_usage #=> %{web_search: %{count: 2, unit: "call"}}

response.usage.cost #=> %{tokens: 0.001, tools: 0.02, images: 0.0, total: 0.021}

Image generation usage

{:ok, response} = ReqLLM.generate_image("openai:gpt-image-1.5", prompt)

response.usage.image_usage #=> %{generated: %{count: 1, size_class: "1024x1024"}}


A native ReqLLM telemetry surface is published for every request, including streaming:

- `[:req_llm, :request, :start | :stop | :exception]` for lifecycle timing, summaries, and usage
- `[:req_llm, :reasoning, :start | :update | :stop]` for standardized thinking and reasoning milestones
- `[:req_llm, :token_usage]` for backwards-compatible token and cost measurements

All events share a `request_id` so you can correlate request lifecycle, reasoning lifecycle, and billing data across providers.

For OpenTelemetry, attach `ReqLLM.OpenTelemetry` once to emit GenAI client spans, optional GenAI metrics, cost attributes, and Langfuse-friendly message capture.
elixir ReqLLM.OpenTelemetry.attach("req-llm-otel", content: :attributes, langfuse: true) ```

See examples/scripts/usage_cost_search_image.exs and run it from examples/ with mix run scripts/usage_cost_search_image.exs for a multi-provider smoke test that validates search tool and image generation cost metadata. For comprehensive documentation, see the Telemetry Guide and Usage & Billing Guide.

StreamResponse Usage Patterns

The new StreamResponse provides flexible access patterns:

```elixir

Keys are picked up from .env files or environment variables - see `ReqLLM.Keys`

model = "anthropic:claude-haiku-4-5"

ReqLLM.generate_text!(model, "Hello world") #=> "Hello! How can I assist you today?"

schema = [name: [type: :string, required: true], age: [type: :pos_integer]] person = ReqLLM.generate_object!(model, "Generate a person", schema) #=> %{name: "John Doe", age: 30}

{:ok, image_response} = ReqLLM.generate_image("openai:gpt-image-1.5", "A simple red square") image_bytes = ReqLLM.Response.image_data(image_response) File.write!("red_square.png", image_bytes)


Note: Google image models gemini-2.5-flash-image and gemini-3-pro-image-preview reject :n; specify the image count in the prompt.
elixir {:ok, response} = ReqLLM.generate_text( model, ReqLLM.Context.new([ ReqLLM.Context.system("You are a helpful coding assistant"), ReqLLM.Context.user("Explain recursion in Elixir") ]), temperature: 0.7, max_tokens: 200 )

{:ok, response} = ReqLLM.generate_text( model, "What's the weather in Paris?", tools: [ ReqLLM.tool( name: "get_weather", description: "Get current weather for a location", parameter_schema: [ location: [type: :string, required: true, doc: "City name"] ], callback: {Weather, :fetch_weather, [:extra, :args]} ) ] )

Streaming Configuration

ReqLLM uses Finch for streaming connections with automatic connection pooling. By default, we use HTTP/1-only pools to avoid a known Finch mixed-protocol ALPN bug with large request bodies:

```elixir

Default configuration (automatic)

config :req_llm, stream_pool_timeout: 120_000, stream_pool_protocols: [:http1], stream_pool_size: 1, stream_pool_count: 8 ```

HTTP/2 Configuration (Advanced)

Important: Due to Finch issue #265, mixed HTTP/1+HTTP/2 ALPN pools may fail when sending request bodies larger than 64KB (large prompts, extensive context windows). This is a bug in Finch's mixed-protocol flow control path, not a limitation of HTTP/2 itself.

If you know all target providers support HTTP/2, you can configure HTTP/2-only pools:

```elixir

HTTP/2-only configuration

config :req_llm, stream_pool_protocols: [:http2], stream_pool_count: 8


**ReqLLM will error with a helpful message if you try to send a large request body with mixed HTTP/1+HTTP/2 pools.** The error will reference this section for configuration guidance.

Streaming responses hold a connection until completion. For high-scale deployments, tune both the Finch pool capacity and the stream checkout timeout:
elixir

High-scale configuration

config/runtime.exs

round_robin = Finch.Pool.Strategy.RoundRobin.new()

config :req_llm, stream_pool_timeout: 300_000, stream_pool_protocols: [:http1], stream_pool_size: 1, stream_pool_count: 32, stream_pool_strategy: {Finch.Pool.Strategy.RoundRobin, round_robin}


With the default HTTP/1 transport, concurrent streams per origin are roughly `stream_pool_size * stream_pool_count`. Prefer increasing `stream_pool_count` first when a single pool worker is under pressure; increase `stream_pool_size` when each worker should hold more concurrent HTTP/1 connections. For high worker counts, a round-robin `stream_pool_strategy` spreads stream starts more evenly than Finch's default random selection. These settings configure ReqLLM's default Finch pool; an explicit `finch: [pools: ...]` configuration takes precedence.

If you need origin-specific pools, HTTP/2, connection options, or pool metrics, configure Finch directly:
elixir

Advanced Finch configuration

config :req_llm, finch: [ name: ReqLLM.Finch, pools: %{ :default => [protocols: [:http1], size: 1, count: 32] } ]


Use `pool_timeout: ...` on an individual `stream_text/3` or `stream_object/4` call when one workload needs a longer connection checkout window than the global `stream_pool_timeout` setting.

Advanced users can specify custom Finch instances per request:
elixir {:ok, response} = ReqLLM.stream_text(model, messages, finch_name: MyApp.CustomFinch) ```

API Key Management

ReqLLM makes key management as easy and flexible as possible - this needs to just work.

Please submit a PR if your key management use case is not covered

Keys are pulled from multiple sources with clear precedence: per-request override → in-memory storage → application config → environment variables → .env files.

```elixir

Advanced Req Plugin API

For advanced non-streaming use cases, you can use ReqLLM providers directly as Req plugins. This is the canonical implementation used by ReqLLM.generate_text/3:

```elixir

Customize the Req pipeline with additional headers or middleware

{:ok, model} = ReqLLM.model("anthropic:claude-haiku-4-5") {:ok, provider_module} = ReqLLM.provider(model.provider) {:ok, request} = provider_module.prepare_request(:chat, model, "Hello!", temperature: 0.7)

🇨🇳 中文文档镜像 AI 翻译 2026-05-23
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

ReqLLM 是一个基于 Elixir 的语言模型(LLM)框架,提供了一个统一的接口来访问不同的语言模型提供商。它支持 45 多个提供商和 665 多个模型,包括 Anthropic、Google、Microsoft 等知名提供商。 ReqLLM 还提供了一个可扩展的架构,使得开发者可以轻松地添加新的提供商和模型。

⚡ 功能介绍

ReqLLM 的主要功能包括:提供商中立的模型注册表,支持 45 多个提供商和 665 多个模型;可扩展的架构,使得开发者可以轻松地添加新的提供商和模型;支持多模态内容部分(文本、图像 URL、工具调用、二进制数据);提供了一个统一的接口来访问不同的语言模型提供商。

📋 环境依赖

ReqLLM 需要 Elixir 1.12 或更高版本,Docker 和 Finch 等依赖包。开发者需要安装这些依赖包才能使用 ReqLLM。

🛠 安装步骤(Docker/pip/源码)

ReqLLM 支持多种安装方式,包括 Igniter、mix deps.get 等。开发者可以选择适合自己的安装方式。

🚀 使用教程

ReqLLM 的使用教程包括了如何访问使用元数据、使用成本跟踪、生成文本、生成图像等功能。开发者可以通过这些教程来快速上手 ReqLLM。

⚙️ 配置说明(含 MCP / env)

ReqLLM 支持多种配置方式,包括环境变量、.env 文件和应用配置。开发者可以通过这些配置方式来定制 ReqLLM 的行为。

🔌 API 说明

ReqLLM 提供了一个 API 来管理 API 密钥。开发者可以通过这个 API 来轻松地管理 API 密钥。

🔄 工作流/模块

ReqLLM 支持通过 Finch 来实现流式连接。开发者可以通过 Finch 来实现流式连接,提高 ReqLLM 的性能和可扩展性。

🎯 aiskill88 AI 点评 A 级 2026-05-23

常用的常用器一个学为常用的常用器。常用的常用器。常用的常用器。

📚 实用指南(长尾问题)
适合谁
  • 构建企业知识库 / RAG 检索应用的团队
  • 跨境业务、多语言内容运营团队
最佳实践
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型
部署方案
  • 本地部署:CPU 8GB 起,GPU 推荐 16GB+ 显存
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
req_llm 中文教程req_llm 安装报错怎么办req_llm 与同类工具对比req_llm 最佳实践req_llm 适合谁用

⚡ 核心功能

👥 适合谁
  • 构建企业知识库 / RAG 检索应用的团队
  • 跨境业务、多语言内容运营团队
⭐ 最佳实践
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +Apache-2.0 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。

🔗 相关工具推荐

📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

起安。
💡 AI Skill Hub 点评

总体来看,可用事为常用的常用器 是一款质量良好的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

📚 深入学习 可用事为常用的常用器
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 req_llm
原始描述 开源AI工具:Req plugin to query AI providers。⭐520 · Elixir
Topics tag1tag2tag3
GitHub https://github.com/agentjido/req_llm
License Apache-2.0
语言 Elixir
🔗 原始来源
🐙 GitHub 仓库  https://github.com/agentjido/req_llm

收录时间:2026-05-19 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →