Skip to content

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

Merged
CJackHwang merged 4 commits intoCJackHwang:devfrom
dinhnn:main
May 7, 2026
Merged

feat: add Ollama API endpoints /api/version, /api/tags, /api/show for Copilot integration#446
CJackHwang merged 4 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 4 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: d0d61a5d77

ℹ️ 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
ModifiedAt string `json:"modified_at"`
}
type OllamaCapabilitiesModelInfo struct {
ID string
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a JSON tag for the Ollama model ID field

/api/show marshals OllamaCapabilitiesModelInfo directly, but ID has no JSON tag, so the response key is emitted as "ID" instead of a lowercase/snake_case API key. Clients that deserialize the show payload using Ollama-style field names (or strict schemas) will not see this identifier field, which can break model metadata parsing even though the endpoint returns 200.

Useful? React with 👍 / 👎.

@CJackHwang CJackHwang changed the base branch from main to dev May 7, 2026 12:35
@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 0:36am

@CJackHwang
Copy link
Copy Markdown
Owner

Thank you for your pull request! If it gets past Lint and Refactor Gate, I'll merge it first.

@CJackHwang
Copy link
Copy Markdown
Owner

CJackHwang commented May 7, 2026

Fine, Iet me handle it.

@CJackHwang CJackHwang merged commit 9062330 into CJackHwang:dev May 7, 2026
11 of 13 checks passed
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