框架与平台
Agno
在 Agno 智能体中使用 TokenLab 模型
概述
Agno Agent 可以通过 OpenAI 兼容模型客户端调用 TokenLab。
环境配置
export TOKENLAB_API_KEY="sk-your-tokenlab-key"TokenLab 模型类
如果当前 Agno 版本包含 TokenLab 模型类,可以直接使用:
from agno.agent import Agent
from agno.models.tokenlab import TokenLab
agent = Agent(model=TokenLab(id="gpt-5.6-luna"))
agent.print_response("Give me a concise project risk checklist.")部分 Agno 构建版本也支持模型字符串:
agent = Agent(model="tokenlab:gpt-5.4-mini")使用 OpenAI 兼容配置
如果你的版本尚未包含 TokenLab,请使用 Agno 的 OpenAI 兼容模型路径,配置如下:
- Base URL:
https://api.tokenlab.sh/v1 - API 密钥:
TOKENLAB_API_KEY - Model:
gpt-5.4-mini
模型 ID 会更新。请从模型页选择当前模型,并在自己的任务上比较效果、速度和费用。