Problem/Motivation
resolveProviderType() decides cloud vs local from a hardcoded provider-id whitelist (ollama, lmstudio, localai, koboldcpp). A local model served over an OpenAI-compatible endpoint through ai_provider_openai has provider_id = openai, so it is recorded as cloud. Those local calls then consume the cloud token quota and show under cloud cost, which breaks the self-hosted FinOps case.
Proposed resolution
Let a self-hosted endpoint be recorded as local instead of cloud. Approach to be decided; should fit the local infra-cost work planned for 2.0.0.
Environment
Drupal 11.3, ai 1.4.3, ai_provider_openai pointed at local Ollama, ai_metering 1.0.0-beta1.
AI assistance
Found through live multi-provider testing (OpenAI provider pointed at local Ollama).
Issue fork ai_metering-3609168
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
codeitwisely commented