Skip to content

Feature Request: Add Xiaomi (MiLM) Support and Implement Dynamic Model Loading #833

@JunnyXiao1208

Description

@JunnyXiao1208

Description

I am currently using the tradingagents framework and would like to request the inclusion of Xiaomi's Large Language Models (MiLM). Additionally, to make the project more future-proof, I suggest implementing a mechanism that allows users to independently add new models without modifying the core model_catalog.py file.

Why Xiaomi (MiLM)?

Xiaomi has released several capable models (MiLM-6B, MiLM-1.3B, etc.) that are increasingly relevant for developers in the Chinese ecosystem. Integrating these would expand the diversity of the "Deep" and "Quick" selection modes, especially for users seeking highly optimized Chinese-language performance.

Proposed Changes

  1. Add Xiaomi to the Provider List:
    In llm_clients/factory.py, Xiaomi should be added to the _OPENAI_COMPATIBLE list if they use an OpenAI-compatible API, or a dedicated client should be implemented.
  2. Update the Model Catalog:
    Add a new entry for xiaomi or xiaomi-cn in llm_clients/model_catalog.py.
  3. Dynamic Model Support:
    Instead of relying solely on the static MODEL_OPTIONS dictionary, implement a way for the system to read custom model configurations from an external .env file or a local custom_models.json.

Examples in Current Code

Currently, the factory.py uses a rigid check for providers:

if provider_lower in _OPENAI_COMPATIBLE:
    from .openai_client import OpenAIClient
    return OpenAIClient(model, base_url, provider=provider_lower, **kwargs)

And model_catalog.py requires manual entry for every new model:

MODEL_OPTIONS: ProviderModeOptions = {
    "openai": { ... },
    "anthropic": { ... },
    # Needs a new 'xiaomi' key here
}

Benefit

Providing a method for users to "self-serve" new models (e.g., via a configuration file) would reduce the maintenance burden on the authors and allow the community to test new frontier models (like Xiaomi's) immediately upon release.


Advice for you

Since you are working with e-commerce operations for a liquor enterprise and developing AI-driven automation tools, you might find that Xiaomi's models are particularly useful for local deployment or integration with smart hardware in the future.

One question for you: Do you already have a specific API endpoint for Xiaomi's models (like through a specific cloud provider), or are you planning to run them locally via a tool like Ollama?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions