Show HN:Gambit,一個用於構建可靠AI代理的開源代理框架
Gambit是一個開源的代理框架,旨在簡化構建、運行和驗證可靠的LLM工作流程。它允許開發者組合具有清晰輸入/輸出和安全機制的、小型且類型的“牌組”,並提供本地執行、追蹤流式傳輸和內建的調試UI。
Navigation Menu
Search code, repositories, users, issues, pull requests...
Provide feedback
We read every piece of feedback, and take your input very seriously.
Saved searches
Use saved searches to filter your results more quickly
To see all available qualifiers, see our documentation.
Agent harness framework for building, running, and verifying LLM workflows
License
Uh oh!
There was an error while loading. Please reload this page.
bolt-foundry/gambit
Folders and files
Latest commit
History
Repository files navigation
Gambit
Gambit helps you build reliable LLM workflows by composing small, typed “decks”
with clear inputs/outputs and guardrails. Run decks locally, stream traces, and
debug with a built-in UI.
Quickstart
Requirements: Node.js 18+ and OPENROUTER_API_KEY (set OPENROUTER_BASE_URL
if
you proxy OpenRouter-style APIs).
Run the CLI directly with npx (no install):
Downloads example files (hello decks plus the examples/ gallery) and sets
environment variables.
Run an example in the terminal (repl):
This example just says "hello" and repeats your message back to you.
Run an example in the browser (serve):
Status quo
Our vision
Using the CLI
Use the CLI to run decks locally, stream output, and capture traces/state.
Run with npx (no install):
Run a deck once:
Drop into a REPL (streams by default):
Run a persona against a root deck (test bot):
Grade a saved session:
Start the Debug UI server:
Tracing and state:
--trace <file> for JSONL traces
--verbose to print events
--state <file> to persist a session.
Using the Simulator
The simulator is the local Debug UI that streams runs and renders traces.
Run with npx (no install):
Start it:
Then open:
It also serves:
The Debug UI shows transcript lanes plus a trace/tools feed. If the deck has an
inputSchema, the UI renders a schema-driven form with defaults and a raw JSON
tab. Local-first state is stored under .gambit/ (sessions, traces, notes).
Using the Library
Use the library when you want TypeScript decks/cards or custom compute steps.
Import the helpers from JSR:
Define inputSchema/outputSchema with Zod to validate IO, and implement
run/execute for compute decks. To call a child deck from code, use
ctx.spawnAndWait({ path, input }). Emit structured trace events with
ctx.log(...).
Author your first deck
Minimal Markdown deck (model-powered): hello_world.deck.md
Run it:
Compute deck in TypeScript (no model call): echo.deck.ts
Run it:
Deck with a child action (calls a TypeScript tool): agent_with_time.deck.md
And the child action: get_time.deck.ts
Run it:
Deno
If you prefer Deno, use the Deno commands below.
Quickstart:
Run a deck:
Start the Debug UI:
About
Agent harness framework for building, running, and verifying LLM workflows
Resources
License
Uh oh!
There was an error while loading. Please reload this page.
Stars
Watchers
Forks
Releases
9
Packages
0
Contributors
3
Languages
Footer
Footer navigation
相關文章