Aalexbit-codemod

openai-to-generalcompute

OpenAI to GeneralCompute migration

openaigeneralcomputemigrationjavascripttypescriptpython
Public
0 executions

Run locally

npx codemod openai-to-generalcompute

Migrate common OpenAI SDK usage to GeneralCompute across JavaScript, TypeScript, TSX/JSX, and Python.

Switch from the OpenAI SDK to GeneralCompute.

This codemod updates your code based on the GeneralCompute Quickstart: https://docs.generalcompute.com/quickstart

What will change:

  1. Import: openai@generalcompute/sdk (Node) or generalcompute (Python)
  2. API key: OPENAI_API_KEYGENERALCOMPUTE_API_KEY
  3. Model name: gpt-4minimax-m2.7 (or your preferred model)

What will stay the same:

  • Method: client.chat.completions.create()
  • Parameters: messages, temperature, stream, etc.
  • Response format: Same structure and types
  • Streaming: Same async iteration pattern

Ready to contribute?

Build your own codemod and share it with the community.