Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Deprecate engine.generate() #541

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

CharlieFRuan
Copy link
Contributor

@CharlieFRuan CharlieFRuan commented Aug 12, 2024

This PR deprecates generate() from all MLCEngineInterface. Its usage can be completely covered by engine.chat.completions() for conversation-style generation, and engine.completions() for raw text completion.

Specifically for using the above two OpenAI APIs for multi-round chat with KV reuse, see examples/multi-round-chat.

We deprecate this because future changes on the engine (e.g. allowing multiple models to be loaded in engine) would break this generate() API and require extra effort to maintain.

Tested with streaming/non-streaming on MLCEngine/WebWorkerMLCEngine to ensure other APIs are not affected.

@CharlieFRuan CharlieFRuan changed the title [Deprecate] Deprecate engine.generate() [API] Deprecate engine.generate() Aug 12, 2024
@CharlieFRuan CharlieFRuan merged commit 4e018b9 into mlc-ai:main Aug 12, 2024
1 check passed
CharlieFRuan added a commit that referenced this pull request Aug 13, 2024
### Changes
- #541
- #542
  - When single model loaded, no change in behavior
- When multiple models loaded, some APIs need to specify which model it
is targeting
  - For more, see PR description (the user-facing section)
  - Also see `examples/multi-models`

### TVMjs
Still compiled at
apache/tvm@1fcb620,
no change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant