Feature: Make create-onchain-agent templates LLM provider-agnostic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- developer-experience, tooling
Research direction
Locate the TypeScript create-onchain-agent template and inspect the generated create-agent.ts and .env.local files, along with the existing @ai-sdk/openai and @langchain/openai usage. Verify the generated agent can select a provider through the proposed environment variables, retains the OPENAI_API_KEY fallback, and runs with npm run dev without editing source files.
Written by the indexing model from the issue text.
Description
Language Implementation
- Python
- TypeScript
Feature Type
- Action Provider Template
- Wallet Provider Template
- Framework Extension
- Core Requirements
- Other
🚀 The feature, motivation and pitch
The create-onchain-agent templates currently hardcode OpenAI as the LLM provider. The generated create-agent.ts uses import { openai } from "@ai-sdk/openai" and calls openai.chat("gpt-4o-mini") directly, and the generated .env.local only includes OPENAI_API_KEY=.
This means a developer using any other provider (Anthropic, Google, OpenRouter, Groq, Ollama, etc.) has to open create-agent.ts and rewrite the model initialization before they can even run the agent.
This is unnecessary because @ai-sdk/openai and @langchain/openai — the packages already installed in the template — natively support connecting to any OpenAI-compatible API via their baseURL option. And all major LLM providers now expose OpenAI-compatible endpoints (Anthropic, Google Gemini, OpenRouter, Groq, Together AI, Ollama).
Proposal: Replace the hardcoded openai("gpt-4o-mini") singleton with createOpenAI({ apiKey, baseURL }) configured via environment variables:
AI_API_KEY— API key for any provider (falls back toOPENAI_API_KEY)AI_BASE_URL— provider's endpoint (optional, defaults to OpenAI)AI_MODEL— model identifier (optional, defaults togpt-4o-mini)
The generated .env.local would include inline examples for all major providers, so a developer with an Anthropic key can just set two env vars and run npm run dev — no code changes needed.
This change:
- Adds zero new dependencies (uses
createOpenAI/ChatOpenAIalready installed) - Is fully backward-compatible (falls back to
OPENAI_API_KEYifAI_API_KEYis not set) - Matches how the core
@coinbase/agentkitlibrary already works: fully LLM-agnostic
Alternatives
Let developers manually edit create-agent.ts after scaffolding. This is the current approach but creates friction for anyone not using OpenAI.
Additional context
The core @coinbase/agentkit library and all framework extensions (agentkit-langchain, agentkit-vercel-ai-sdk) are already fully LLM-agnostic. The OpenAI lock-in exists only in the scaffolding layer. The Python create-onchain-agent has the same issue.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 831
- Avg merge
- 13h 31m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coinbase/agentkit
-
coinbase-agentkit 0.7.x fails on fresh install: imports solana.rpc.api, which solana>=0.37 removedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 48/100
coinbase/agentkit#1521 · 14 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
coinbase/agentkit#1512 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
All issues in coinbase/agentkit
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
betagouv/mon-entreprise#4699 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4547 · 3 comments ·
Maintainers usually reply within 1 day
-
ai-driven-qa
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
linagora/twake-calendar-frontend#1467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
need4deed-org/sdk#267 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
auth0/universal-login#414 ·
Maintainers usually reply within 1 day