langroid icon indicating copy to clipboard operation
langroid copied to clipboard

feat: add AIML API provider

Open D1m7asis opened this issue 6 months ago โ€ข 5 comments

What does this PR do?

This PR adds support for the AI/ML API provider โ€” a flexible, OpenAI-compatible platform that offers access to 300+ models (e.g., GPT-4o, Claude, Gemini, DeepSeek). It enables users to configure and use aimlapi/<model> as a valid chat_model within Langroid.

โœ… Changes included:

  • AIML_API_KEY added to .env-template
  • Docs updated (llm-usage-options.md, non-openai-llms.md, local-llm-setup.md, supported-models.md)
  • aimlapi/ support added in openai_gpt.py for config parsing and base URL override
  • Custom headers X-Title and Referer added for tracking
  • Sync and async test cases for several aimlapi/* models
  • Provider key logic extended in test_keys()

๐Ÿ“˜ Documentation

Documentation added in the following files:

  • llm-usage-options.md
  • non-openai-llms.md
  • local-llm-setup.md
  • supported-models.md

๐Ÿงช Verification

All added tests (test_llm_aimlapi, test_llm_aimlapi_async) pass and return expected values for AIMLAPI models.


Let me know if anything should be adjusted or restructured!

D1m7asis avatar Jun 23 '25 14:06 D1m7asis

From https://github.com/langroid/langroid/issues/860

D1m7asis avatar Jun 23 '25 14:06 D1m7asis

From #860

Thank you. I will try to review it in the next week or so.

pchalasani avatar Jul 08 '25 22:07 pchalasani

Hi! @pchalasani Can you pls look at the pr? Thanks!

D1m7asis avatar Aug 20 '25 09:08 D1m7asis

Hi! @pchalasani Can you pls look at the pr? Thanks!

Thanks, will review in a few days.

pchalasani avatar Aug 20 '25 11:08 pchalasani

Hi @pchalasani! Let me know if any changes need to be implemented after your review, we'll do those within 1-2 days

OctavianTheI avatar Sep 04 '25 09:09 OctavianTheI