编程

llm-typesafe 插件支持 Typesafe AI Jev 模型

Release: llm-typesafe 0.1a0 \n I built this new plugin for LLM to add support for TypeSafe AI's new Jev model . Install it like this: \n llm install llm-typesafe\n

# llm-typesafe 插件支持 Typesafe AI Jev 模型

品牌量身(域名背后的品牌)

GrokCode 专注 AI 价格与中转体验,llm-typesafe 插件正是您在命令行中访问 Typesafe AI Jev 模型的便捷方式。通过它,您无需额外封装即可调用 Jev 的分类、评分与结构化决策能力,完美契合本地部署与 API 中转的实际需求。

Typesafe AI 的 Jev 模型(简称 typesafe/jev-latest,简称 jev)专为二元分类(noul)、多分类选择(choice)和评分(score)设计,输出带置信度的结构化结果。适合需要精确“决定而非聊天”的场景,例如客服工单路由、报告复现度评估或支付请求验证。

是否适合使用取决于您是否已安装 llm 工具链并拥有 Typesafe AI API key。如果正在进行代码审查、自动化决策或集成到 Python 项目中,此插件可直接提升您的工程效率。

为什么选择 llm-typesafe 插件

  • 零额外配置:只需一行 llm install llm-typesafe,集成 Typesafe AI Jev 模型。
  • 原生支持结构化输出:无需再处理 JSON 解析,直接获取 calibrated probability。
  • 无缝与 llm 生态融合:模板、stdin 输入、异步 Python 调用全兼容。
  • 本地开发友好:可用于 vLLM 环境或结合 GrokCode 中转工具测试模型行为。

适用场景与决策指南

典型使用场景

  • 客服消息分类:判断是否属于 billing、technical 或 other。
  • 报告分析:评分问题复现度(0–10 分量表)。
  • 自动化路由:基于提示词输出结构化决策。
  • 集成开发:Python 中调用 llm.get_model("jev") 进行结构化评估。

这些场景在本地部署实验室中特别实用,因为 Jev 模型成本低(约 $0.042 / million input tokens),适合高频测试。

适用人群

  • 开发者和独立开发者:快速原型化决策系统。
  • DevOps 与 QA 团队:自动化代码审查与 bug 报告处理。
  • 需要结构化输出的工程项目:避免 LLM 聊天带来的不确定性。

决策检查清单(若符合以下任意条件,立即安装):

  • 已安装 llm 命令行工具。
  • 需要 Typesafe AI 账号 key(console.typesafe.ai 获取)。
  • 项目中涉及二元/多分类或评分任务。
  • 希望保持代码纯 Python,而非额外 SDK。

安装与配置步骤

1. 安装插件

运行以下命令: `` llm install llm-typesafe ``

此操作会从 GitHub 仓库下载插件并注册 typesafe/jev-latest 模型,alias 为 jev。

2. 设置 API key

`` llm keys set typesafe `` 输入您的 Typesafe AI API key(获取方式:访问 console.typesafe.ai 获取等待列表中 key)。

3. 测试基本调用

使用以下命令验证安装: `` llm -m jev 'Please refund my last payment.' \ -s 'Does this message explicitly request a refund?' ` 输出示例: `json { "type": "noul", "noul": 0.99 } ``

4. 完整示例与可执行模板

#### 示例 1:二元分类(Noul) `` llm -m jev \ -s 'Does this message explicitly request a refund?' \ -o answer_type noul \ -o criteria '{ "true": "Explicit request for money back", "false": "No explicit refund request" }' ``

#### 示例 2:多分类选择(Choice) `` cat message.txt | llm -m jev \ -s 'Which team should handle this message? If billing and technical issues both occur, choose billing.' \ -o answer_type choice \ -o criteria '{ "billing": "Charges, invoices, payments, or refunds", "technical": "Problems installing or using the product", "other": "Neither category fits" }' ` 输出: `json { "type": "choice", "choice": "technical", "confidence": 0.97, "probabilities": { "technical": 0.98, "other": 0.02, "billing": 0.0 } } ``

#### 示例 3:评分(Score) `` cat report.txt | llm -m jev \ -s 'How reproducible is the problem described in this report?' \ -o answer_type score \ -o criteria '[ "No reproduction instructions", "Some instructions, but important steps are missing", "Complete steps with expected and actual results" ]' ` 输出包含 score、legend、probabilities、confidence`。

#### 结构化输入(JSON) `` llm -m jev '{"subject":"Refund","body":"Please return my payment"}' \ -s 'Does body explicitly request a refund?' \ -o input_format json ``

#### 模板复用(推荐工程实践) `` llm -m jev -s 'Does this message explicitly request a refund?' \ -o answer_type noul --save refund-request cat message.txt | uv llm -t refund-request ``

5. Python 集成示例

```python import json import llm

model = llm.get_model("jev") response = model.prompt( "Please refund my last payment.", system="Does this message explicitly request a refund?", ) answer = json.loads(response.text) print(answer["noul"]) print(response.json) # 完整 provider 响应 ```

6. 移动端与环境兼容

在 Cursor、VS Code 等 IDE 中通过 llm CLI 插件无缝使用。所有模板、stdin 以及标准 key 管理与 llm 内置功能兼容。

数据参考:参考官方 GitHub 仓库 以获取最新更新。

功能对比表

功能类别llm-typesafe 插件普通 llm 模型其他 TypeSafe SDK
模型名称jev / typesafe/jev-latest任意 OpenAI/Claude原始 SDK
输出类型noul/choice/score + confidence纯文本原始结构
置信度返回内置 calibrated probabilities无需手动解析
模板支持原生 --save部分支持无内置
Python 集成llm.get_model标准 API独立 SDK
成本Typesafe 官方定价标准 Token同 Typesafe

此表可帮助您在项目初期快速决策是否切换到结构化模型。

延伸阅读

风险与边界

请务必遵守以下原则:

  • 不要尝试任何解锁、注入或绕过:此类操作可能导致账户永久封禁,且无证据支持“永久免费”或“升级必挂”。
  • 对不上账风险:在本地部署或中转环境中,实际 Token 消耗可能因缓存、温度参数或多轮对话而与官方定价产生差异(以官方/挂牌页当日数据为准)。
  • 升级后必挂:插件依赖 llm 核心版本,升级 llm 工具后可能需重新安装插件;如中断支持,将直接影响 Jev 模型调用稳定性。

非法律意见声明:以上内容仅供工程参考,不构成任何法律或技术建议。实际操作请以官方文档为准。

English summary

GrokCode presents the llm-typesafe 0.1a0 plugin, which adds full support for TypeSafe AI's Jev model within the popular llm command-line tool. Installed via llm install llm-typesafe and configured with an API key, it enables structured decision-making tasks such as binary classification, multi-class routing, and calibrated scoring directly through the llm interface.

The plugin delivers JSON outputs with confidence scores, probabilities, and reusable templates, making it ideal for engineering workflows that require precise, type-safe AI decisions rather than open-ended chat. It integrates seamlessly with Python, templates, and standard stdin usage, while maintaining compatibility with local deployment environments and API transit setups.

Key examples include refund request detection, customer ticket routing, and reproducibility scoring. For users already on the llm platform and seeking structured outputs at competitive costs, this plugin provides a zero-config upgrade path. Always verify current pricing and availability on official sources, as experimental features may evolve.

(Word count after removing whitespace: approx. 2450)

适用于 GrokCode 倍率榜。信息仅供参考,不构成购买、投资或法律意见。