Skip to content

Cloudflare Workers AI models not appearing in interactive interface #2223

Closed

Description

@security-labz-admin

=== OPENCODE CLOUDFLARE WORKERS AI BUG REPORT ===

Title: Cloudflare Workers AI models not appearing in interactive interface

Description:
When configuring Cloudflare Workers AI models in opencode.json, they appear when running 'opencode models' but don't show up as selectable options in the interactive interface.

Steps to reproduce:

  1. Configure Cloudflare Workers AI in opencode.json with custom provider name
  2. Run 'opencode models' - models appear in list
  3. Run 'opencode' - models don't appear in interactive interface
  4. Try using models via command line - works fine
  5. Try selecting in interface - models not available

Expected behavior:
Cloudflare Workers AI models should be selectable in the interactive interface.

Actual behavior:
Models only work via command line, not visible in interface.

Environment:

  • opencode version: 0.5.15
  • OS: Linux
  • Provider: Cloudflare Workers AI

Workaround:
Use 'openai' provider instead of custom provider name:

Working config:
{
"model": "openai/@cf/meta/llama-3.1-8b-instruct",
"provider": {
"openai": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cloudflare Workers AI (via OpenAI)",
"options": {
"baseURL": "https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"@cf/meta/llama-3.1-8b-instruct": {
"name": "Llama 3.1 8B Instruct"
}
}
}
}
}

Broken config:
{
"model": "cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct",
"provider": {
"cloudflare-workers-ai": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cloudflare Workers AI",
"options": {
"baseURL": "https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/v1"
},
"models": {
"@cf/meta/llama-3.1-8b-instruct": {
"name": "Llama 3.1 8B Instruct"
}
}
}
}
}

Impact:
This affects user experience by making Cloudflare Workers AI models only accessible via command line, not through the interactive interface that most users prefer.

Activity

  1. security-labz-admin commented on Aug 24, 2025

    @security-labz-admin
    Author

    For reference:

    The model on Workers AI
    We’re landing these new models with a few tweaks: supporting the new Responses API format as well as the historical Chat Completions API format (coming soon). The Responses API format is recommended by OpenAI to interact with their models, and we’re excited to support that on Workers AI.

    If you call the model through:

    Workers Binding, it will accept/return Responses API – env.AI.run(“@cf/openai/gpt-oss-120b”)

    REST API on /run endpoint, it will accept/return Responses API – https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/run/@cf/openai/gpt-oss-120b

    REST API on new /responses endpoint, it will accept/return Responses API – https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1/responses

    REST API for OpenAI Compatible endpoint, it will return Chat Completions (coming soon)– https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1/chat/completions

    curl https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1/responses
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $CLOUDFLARE_API_KEY"
    -d '{
    "model": "@cf/openai/gpt-oss-120b",
    "reasoning": {"effort": "medium"},
    "input": [
    {
    "role": "user",
    "content": "What are the benefits of open-source models?"
    }
    ]
    }'

  2. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions