Skip to content

ADFA-3017 | Add OpenAI-compatible AI backend - #67

Open
jatezzz wants to merge 1 commit into
refactor/ADFA-5096-split-ai-backend-pluginsfrom
feat/ADFA-3017-openai-compatible-backend
Open

ADFA-3017 | Add OpenAI-compatible AI backend#67
jatezzz wants to merge 1 commit into
refactor/ADFA-5096-split-ai-backend-pluginsfrom
feat/ADFA-3017-openai-compatible-backend

Conversation

@jatezzz

@jatezzz jatezzz commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the new ai-agent-openai plugin as an OpenAI-compatible inference backend for ai-core.

The implementation supports OpenAI and compatible servers such as Ollama, LM Studio, OpenRouter, and llama-server through a configurable base URL. It includes streaming inference, configurable model selection, secure API key storage, connection verification, server presets, error handling, and reasoning-model request compatibility.

The repository documentation is also updated to include the new backend and its configuration, installation, security, and usage details.

Details

  • Registers the openai inference backend with ai-core.
  • Adds OpenAI-compatible chat completion and SSE streaming support.
  • Supports configurable OpenAI-compatible server URLs.
  • Adds server presets for OpenAI, Ollama, LM Studio, OpenRouter, and llama.cpp.
  • Adds secure API key storage using Android Keystore and AES/GCM.
  • Handles API key requirements based on the configured server.
  • Adds connection testing and model catalog retrieval.
  • Supports editable model selection and remembered models.
  • Handles reasoning-model parameter differences and unsupported-parameter retries.
  • Adds URL validation and controlled HTTP support for local/private servers.
  • Adds backend, settings, error handling, logging, security, and prompt layers.
  • Adds plugin documentation and configuration resources.
  • Adds JVM unit tests covering request building, model filtering, request tuning, SSE parsing, errors, URL policies, model selection, and connection state.

🎦 Demo in ticket

Ticket

ADFA-3017

Observation

The backend intentionally uses direct HTTP communication instead of an OpenAI SDK to avoid dependency and classloader conflicts with CodeOnTheGo.

Native function calling is not enabled; the backend relies on ai-core's provider-agnostic agent flow. API keys remain optional for compatible local/private servers and are required only when appropriate for the configured endpoint.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch from 1a3b533 to 4cfed82 Compare August 13, 2026 21:54
Registers the `openai` backend with ai-core: POST {baseUrl}/chat/completions over HttpURLConnection, with the base URL as a setting defaulting to OpenAI. One backend covers OpenAI, Ollama, LM Studio, OpenRouter and llama-server, since only the host differs between them (ADFA-3017, ADFA-3452).

The API key is optional unless the URL is OpenAI's own host, the model is a free-text field, and /v1/models is treated as optional — the three things that would each make the backend unusable for a self-hosted server. Reasoning-model parameters are chosen from the model id and a refused one is retried without. No changes to ai-core.
@jatezzz
jatezzz force-pushed the feat/ADFA-3017-openai-compatible-backend branch from 6f78a3b to 7d49aa2 Compare August 13, 2026 21:55
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