gspark-agent
面向 AI Agent 的 G-spark / HUB 接入工具:CLI + MCP,共用同一套 /v1 客户端。
安装
pipx install "gspark-agent[mcp]"
gspark setup # 【必做】向用户索取 sk_,写入 ~/.gspark/credentials.env
gspark agent-guide # 打印内置说明书
开发(本仓库):
pip install "./packages/gspark-agent[mcp]"
配置
推荐:
gspark setup
# 或非交互:
gspark setup --api-key sk_xxxx --base-url https://www.g-spark.cn
也可手动环境变量:
export GSPARK_API_KEY=sk_xxxx
export GSPARK_BASE_URL=https://www.g-spark.cn # 兼容 api.g-spark.cn;或其他节点如 https://api.hqszh.com
兼容别名:HUB_API_KEY、HUB_BASE_URL。CLI 还会自动读取 ~/.gspark/credentials.env 与当前目录 .env。
CLI
gspark setup
gspark agent-guide
gspark apps list --json
gspark apps show video_01 --json
gspark tasks estimate --app video_01 --input prompt="hello" --json
gspark tasks run --app video_01 --input prompt="hello" --wait --json
gspark tasks get <task_id> --json
gspark chat models --json
gspark chat ask -m gpt-5-mini "你好" --json
# Python / MCP 可传 tools、tool_choice、多模态 messages(见 docs/LLM-GATEWAY.md)
gspark account balance --json
gspark account ledger --page 1 --size 20 --json
--json:紧凑单行 JSON(便于 Agent / 管道)- 默认:缩进 JSON;
account ledger默认为表格
--input 支持 JSON 数组/对象,例如:--input tags='["a","b"]'、--input meta='{"k":1}'。
MCP(Cursor)
见 agent_pack/mcp-config.example.json;控制台「Agent专属」页可下载完整接入包。
gspark-mcp
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gspark_agent-0.6.1.tar.gz
(22.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gspark_agent-0.6.1.tar.gz.
File metadata
- Download URL: gspark_agent-0.6.1.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.0a6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baeed76a1e2cded0b6872f9e2151d9411186ae43c25cf7d46ed2692089fbcd3c
|
|
| MD5 |
621c15e8d80d169b6945b34c46412fcb
|
|
| BLAKE2b-256 |
7f033f6b8199fbbb53991419e750cbdd74a99621c41c82eb2c74277e6b37a6e1
|
File details
Details for the file gspark_agent-0.6.1-py3-none-any.whl.
File metadata
- Download URL: gspark_agent-0.6.1-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.0a6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14631cb64f6cf5fdb14388d03b75b4958b8bc2d1e07dbe2216d522b90541c202
|
|
| MD5 |
cc2a94b77109aefbe7297156cc770529
|
|
| BLAKE2b-256 |
cc82001b761d9e5c40d81fc9deebf1137a8ae2a884deb7e1b8dd7a9835297318
|