internal/agent/.env.sample 🔗
@@ -1,4 +1,5 @@
CRUSH_ANTHROPIC_API_KEY=
+CRUSH_HYPER_API_KEY=
CRUSH_OPENAI_API_KEY=
CRUSH_OPENROUTER_API_KEY=
CRUSH_ZAI_API_KEY=
Andrey Nering created
It takes a lot of time to re-record these VCRs for so many models.
Sometimes they fail intermittently, and you need to manually re-record
again and again until it works.
Let's keep a single provider and models which should work well enough for
us.
internal/agent/.env.sample | 1
internal/agent/agent_test.go | 5 ---
internal/agent/common_test.go | 48 ++----------------------------------
3 files changed, 5 insertions(+), 49 deletions(-)
@@ -1,4 +1,5 @@
CRUSH_ANTHROPIC_API_KEY=
+CRUSH_HYPER_API_KEY=
CRUSH_OPENAI_API_KEY=
CRUSH_OPENROUTER_API_KEY=
CRUSH_ZAI_API_KEY=
@@ -26,10 +26,7 @@ func TestMain(m *testing.M) {
}
var modelPairs = []modelPair{
- {"anthropic-sonnet", anthropicBuilder("claude-sonnet-4-6"), anthropicBuilder("claude-haiku-4-5-20251001")},
- {"openai-gpt-5", openaiBuilder("gpt-5"), openaiBuilder("gpt-4o")},
- {"openrouter-kimi-k2", openRouterBuilder("moonshotai/kimi-k2-0905"), openRouterBuilder("qwen/qwen3-next-80b-a3b-instruct")},
- {"zai-glm4.6", zAIBuilder("glm-4.6"), zAIBuilder("glm-4.5-air")},
+ {"glm-5.1", hyperBuilder("glm-5.1"), hyperBuilder("gpt-oss-120b")},
}
func getModels(t *testing.T, r *vcr.Recorder, pair modelPair) (fantasy.LanguageModel, fantasy.LanguageModel) {
@@ -10,10 +10,7 @@ import (
"charm.land/catwalk/pkg/catwalk"
"charm.land/fantasy"
- "charm.land/fantasy/providers/anthropic"
- "charm.land/fantasy/providers/openai"
"charm.land/fantasy/providers/openaicompat"
- "charm.land/fantasy/providers/openrouter"
"charm.land/x/vcr"
"github.com/charmbracelet/crush/internal/agent/prompt"
"github.com/charmbracelet/crush/internal/agent/tools"
@@ -50,50 +47,11 @@ type modelPair struct {
smallModel builderFunc
}
-func anthropicBuilder(model string) builderFunc {
- return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
- provider, err := anthropic.New(
- anthropic.WithAPIKey(os.Getenv("CRUSH_ANTHROPIC_API_KEY")),
- anthropic.WithHTTPClient(&http.Client{Transport: r}),
- )
- if err != nil {
- return nil, err
- }
- return provider.LanguageModel(t.Context(), model)
- }
-}
-
-func openaiBuilder(model string) builderFunc {
- return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
- provider, err := openai.New(
- openai.WithAPIKey(os.Getenv("CRUSH_OPENAI_API_KEY")),
- openai.WithHTTPClient(&http.Client{Transport: r}),
- )
- if err != nil {
- return nil, err
- }
- return provider.LanguageModel(t.Context(), model)
- }
-}
-
-func openRouterBuilder(model string) builderFunc {
- return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
- provider, err := openrouter.New(
- openrouter.WithAPIKey(os.Getenv("CRUSH_OPENROUTER_API_KEY")),
- openrouter.WithHTTPClient(&http.Client{Transport: r}),
- )
- if err != nil {
- return nil, err
- }
- return provider.LanguageModel(t.Context(), model)
- }
-}
-
-func zAIBuilder(model string) builderFunc {
+func hyperBuilder(model string) builderFunc {
return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
provider, err := openaicompat.New(
- openaicompat.WithBaseURL("https://api.z.ai/api/coding/paas/v4"),
- openaicompat.WithAPIKey(os.Getenv("CRUSH_ZAI_API_KEY")),
+ openaicompat.WithBaseURL("https://hyper.charm.land/v1"),
+ openaicompat.WithAPIKey(os.Getenv("CRUSH_HYPER_API_KEY")),
openaicompat.WithHTTPClient(&http.Client{Transport: r}),
)
if err != nil {