Skip to content

feat: add Ollama API endpoints /api/version, /api/tags, /api/show for Copilot integration#442

Closed
dinhnn wants to merge 2 commits intoCJackHwang:devfrom
dinhnn:main
Closed

feat: add Ollama API endpoints /api/version, /api/tags, /api/show for Copilot integration#442
dinhnn wants to merge 2 commits intoCJackHwang:devfrom
dinhnn:main

Conversation

@dinhnn
Copy link
Copy Markdown
Contributor

@dinhnn dinhnn commented May 7, 2026

Summary

This MR adds support for three essential Ollama API endpoints to enable seamless integration with Copilot:

  • /api/version
  • /api/tags
  • /api/show

Changes

  • Implemented GET /api/version to retrieve Ollama version info
  • Implemented GET /api/tags to list available models
  • Implemented POST /api/show to display model capabilities

Why

These endpoints are required for Copilot to:

  • Verify Ollama compatibility
  • Fetch available models for selection
  • Retrieve model metadata for context handling

Testing

  • Unit tests added for all three endpoints
  • Verified Copilot integration in staging environment

API Examples

# Version
curl http://localhost:6011/api/version

# Tags
curl http://localhost:6011/api/tags

# Show  
curl http://localhost:6011/api/show -d '{
    "model":"deepseek-v4-flash"
}'

CJackHwang and others added 2 commits May 6, 2026 00:38
Merge pull request CJackHwang#433 from CJackHwang/codex/flash-searchpro-search

Remove heuristic model name resolution and require explicit aliases or canonical IDs
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

Someone is attempting to deploy a commit to the cjack's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a68a79e087

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/config/models.go
Comment on lines +281 to +282
canonical, ok := ResolveModel(store, id)
if !ok {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Normalize models/-prefixed IDs before resolving

/api/show forwards payload.model directly into ResolveModel, which only accepts canonical model names or configured aliases. Inputs like "models/deepseek-v4-pro" therefore resolve to not found and return 404, even though they refer to supported models (this exact form is exercised in the added route tests). Any Copilot/Ollama client that sends prefixed model IDs will fail model capability discovery.

Useful? React with 👍 / 👎.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment May 7, 2026 5:28am

@CJackHwang CJackHwang changed the base branch from main to dev May 7, 2026 05:28
@dinhnn dinhnn closed this May 7, 2026
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.

2 participants