Skip to content

[Bug] API Key missing from background model discovery/capabilities requests breaks tool support on llama.cpp #696

Description

@lundelltravis

Description

When connecting OGAM to an remote llama.cpp server (llama-server) with an API key configured in custom server settings, available tool-calling / function-calling features disappear from the chat interface.

Inspecting server logs and verifying endpoints via curl confirms that OGAM drops the Authorization: Bearer <KEY> header during background model discovery and property inspection calls (GET /v1/models). llama-server rejects these unauthenticated background checks with 401 Unauthorized, causing OGAM to fall back to a "no-tools-supported" UI state and hide the tool options.

Steps to Reproduce

  1. Start llama-server with --api-key <YOUR_KEY> enabled.
  2. In OGAM custom server settings, set the endpoint URL (e.g., http://<SERVER_IP>:8080/v1) and input the matching API Key.
  3. Observe llama-server terminal logs upon connecting: a series of 401 Unauthorized errors occur immediately on background requests.
  4. Open a chat; tool-calling features are missing/disabled in the UI.
  5. Remove --api-key from llama-server and clear the API key in OGAM settings.
  6. Reconnect—discovery succeeds with 200 OK, and tool features immediately become available.

Expected Behavior

OGAM should append the configured API Key (Authorization: Bearer <KEY>) to all outgoing HTTP requests sent to the remote OpenAI-compatible base URL, including initial model discovery (GET /v1/models), property evaluations (GET /v1/props), and text generation streams.

Actual Behavior

OGAM appears to omit the Authorization header during initial discovery calls, causing llama-server to return 401 Unauthorized and forcing OGAM to disable tool support for the endpoint.

Environment

  • Platform: Android
  • OS Version: Android 16
  • Device: OnePlus 12r
  • App Version: v0.0.110 - APK Download
  • Model in use: Remote Server gemm4-12b (GGUF via llama-server)

Logs

1.05.221.341 W srv    operator(): unauthorized: Invalid API Key
1.05.258.326 W srv    operator(): unauthorized: Invalid API Key
1.05.368.566 W srv    operator(): unauthorized: Invalid API Key
1.05.516.514 W srv    operator(): unauthorized: Invalid API Key
1.05.594.049 W srv    operator(): unauthorized: Invalid API Key
1.05.627.454 W srv    operator(): unauthorized: Invalid API Key
1.05.775.239 W srv    operator(): unauthorized: Invalid API Key
1.05.991.369 W srv    operator(): unauthorized: Invalid API Key

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions