Skip to content

List all the missing APIs#2283

Merged
sachinprasadhs merged 9 commits intokeras-team:masterfrom
sachinprasadhs:missing_API
Feb 19, 2026
Merged

List all the missing APIs#2283
sachinprasadhs merged 9 commits intokeras-team:masterfrom
sachinprasadhs:missing_API

Conversation

@sachinprasadhs
Copy link
Collaborator

@sachinprasadhs sachinprasadhs commented Feb 7, 2026

  • Listed all the missing APIs which was exported in Keras
  • Reorganized the APIs to it's appropriate sections.

Reverted the below changes, will add this in a separate PR

  • Introduced Aliases section for multiple API endpoints.

Below is the sample output for Aliases section:
image

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sachinprasadhs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to comprehensively list and expose a broader range of Keras APIs within the api_master.py configuration. By adding numerous functions, classes, and utilities, it enhances the discoverability and accessibility of Keras functionalities, from fundamental building blocks and specialized layers to various helper functions for image processing, model management, and system configuration. This effort serves as a foundational step towards a more complete and organized public API surface for Keras.

Highlights

  • API Expansion: Significantly increased the number of publicly exposed Keras APIs across various modules, including core components, layers, activations, initializers, regularizers, constraints, metrics, losses, and utility functions.
  • New API Categories: Introduced several new top-level API sections, such as "Core API", "Layer utilities", "Callback utilities", "Other ops", "Tree API", "Bounding boxes utilities", "Visualization utilities", and more, to improve API organization and discoverability.
  • Serialization/Deserialization Utilities: Added deserialize, get, and serialize functions for various Keras components (e.g., activations, initializers, metrics, losses, dtype policies) to the exposed API.
  • Backend and Configuration Enhancements: Exposed additional backend and configuration utilities, including functions for managing backend settings, flash attention, and epoch/step limits.
  • Dataset and Application Model Additions: Included more dataset loading functions and preprocessing utilities for various Keras application models.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • scripts/api_master.py
    • Added keras.models.Model and keras.models.Sequential as aliases for keras.Model and keras.Sequential respectively.
    • Included keras.models.save_model and keras.models.load_model for model saving.
    • Introduced a new "Core API" section exposing fundamental Keras classes like keras.Function, keras.KerasTensor, keras.Layer, keras.Optimizer, etc.
    • Expanded activations with hard_swish, sparse_sigmoid, swish, and utility functions (deserialize, get, serialize).
    • Added keras.initializers.Initializer and various functional initializers (zeros, ones, he_normal, etc.) along with utility functions.
    • Included functional regularizers (l1, l2, l1_l2) and utility functions.
    • Added functional constraints (max_norm, non_neg, unit_norm) and utility functions.
    • Added keras.layers.Input and keras.layers.InputSpec aliases.
    • Included keras.layers.ReversibleEmbedding.
    • Created a "Layer utilities" section for functions like keras.layers.add, concatenate, InputLayer, etc.
    • Added aliases for convolution layers (e.g., keras.layers.Convolution1D).
    • Added aliases for pooling layers (e.g., keras.layers.MaxPool1D, keras.layers.AvgPool1D).
    • Introduced a "Callback utilities" section for keras.callbacks.CallbackList, History, OrbaxCheckpoint.
    • Expanded keras.ops.image with elastic_transform, extract_patches_3d, scale_and_translate.
    • Added keras.ops.ifft2 and a new "Other ops" section for various keras.ops functions.
    • Created an "Optimizer utilities" section for deserialize, get, serialize functions for optimizers and their schedules.
    • Expanded metrics with various accuracy metrics, huber, PearsonCorrelation, ConcordanceCorrelation, and utility functions.
    • Added new loss functions (CategoricalGeneralizedCrossEntropy, Circle) and utility functions.
    • Introduced a "Tree API" section for keras.tree utilities.
    • Added keras.datasets.reuters.get_label_names and keras.datasets.boston_housing.load_data.
    • Included aliases for VGG16 and VGG19 under keras.applications.
    • Created an "Applications preprocessing utilities" section for numerous decode_predictions and preprocess_input functions from various application models.
    • Added keras.dtype_policies.GPTQDTypePolicy and utility functions.
    • Included keras.quantizers.Int4QuantizationConfig and Float8QuantizationConfig.
    • Added keras.backend.is_keras_tensor and keras.utils.unpack_x_y_sample_weight.
    • Created "Bounding boxes utilities", "Visualization utilities", "Saving and loading utilities", "Preprocessing utilities", and "Backend utilities" sections under keras.utils and keras.backend.
    • Expanded keras.config with functions for backend settings, flash attention, epochs, and name scoping.
Activity
  • The author has identified that the current API listing is a preliminary step, noting that further reorganization and potential removals might be necessary based on feedback.
  • Specific questions have been raised regarding the handling of serialize, get, and deserialize functions.
  • The author also noted potential compatibility issues with Keras 3.13.2 for newly exposed APIs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sachinprasadhs sachinprasadhs marked this pull request as draft February 7, 2026 01:28
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request does a great job of adding many missing APIs to the documentation master file. My review focuses on improving the organization and consistency of these new additions, in line with your request for feedback on reorganization. I've suggested refactoring the new 'Core API' and 'layer_utilities' sections to avoid duplication and group related items, and proposed a consistent approach for documenting serialization utility functions across different modules. These changes should help improve the structure and maintainability of the API documentation.

Copy link
Contributor

@hertschuh hertschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! They are a number of useful things we should add.

But remove all the aliases.

@sachinprasadhs
Copy link
Collaborator Author

sachinprasadhs commented Feb 18, 2026

Done,

  • Addressed the majority comments about aliases by adding a alias section, which renders like below.

  • Moved the application preprocessing under their model paths.

  • removed .serialize .get .deserialize mentions everywhere.

Screenshot 2026-02-17 at 8 33 25 PM

@sachinprasadhs sachinprasadhs marked this pull request as ready for review February 18, 2026 23:03
@sachinprasadhs
Copy link
Collaborator Author

@hertschuh Thanks for the detailed review, I have addressed the remaining comments and marked as resolved.
Only 3 comments are pending for which I need some clarity from you.
Also, check my previous comment about Aliases.

@hertschuh
Copy link
Contributor

@hertschuh Thanks for the detailed review, I have addressed the remaining comments and marked as resolved. Only 3 comments are pending for which I need some clarity from you. Also, check my previous comment about Aliases.

Done

"keras.quantizers.Int8QuantizationConfig",
"keras.quantizers.Int4QuantizationConfig",
"keras.quantizers.Float8QuantizationConfig",
"keras.quantizers.GPTQConfig",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add keras.quantizers.AWQConfig?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's still not part of 3.13

@sachinprasadhs
Copy link
Collaborator Author

Done, reverted the aliases changes.

For the aliases logic to work in a different PR or to automate this, there are 2 scenarios we consider as aliases right?

Case1: @keras_export("keras.losses.Circle") and @keras_export("keras.losses.circle")

Case 2: @keras_export(["keras.Model", "keras.models.Model"])

Is there any other way we can consider as aliases, especially for ops.

@hertschuh
Copy link
Contributor

Done, reverted the aliases changes.

For the aliases logic to work in a different PR or to automate this, there are 2 scenarios we consider as aliases right?

Case1: @keras_export("keras.losses.Circle") and @keras_export("keras.losses.circle")

Case 2: @keras_export(["keras.Model", "keras.models.Model"])

Is there any other way we can consider as aliases, especially for ops.

No, that's it. So case 2 is the one we should document automatically.

Case 1 is not a "true" alias. Maybe we should reconsider if we document them (as separate symbols).

Copy link
Contributor

@hertschuh hertschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sachinprasadhs sachinprasadhs merged commit 76da690 into keras-team:master Feb 19, 2026
3 checks passed
@sachinprasadhs sachinprasadhs deleted the missing_API branch February 19, 2026 23:01
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.

2 participants