Skip to main content

codex-deepseek-vision

License: MIT Python 3.9+ Release

Codex vision bridge for DeepSeek V4 Flash and other text-only models. Package/CLI: agent-vision. DeepSeek V4 Flash now speaks the Responses protocol and runs inside Codex/ChatGPT, but the model itself is text-only and cannot see images. agent-vision is a free local vision proxy: pasted images and view_image calls are converted into text through an OpenAI-compatible vision API (free GLM-4V-Flash by default) before DeepSeek reasons. No Ollama, no GPU, no model swap.

English | 中文

Why

Text-only agents cannot see pasted screenshots, local images, charts, or error dialogs. Replacing the model usually means paying more or changing your whole workflow. agent-vision sits between the agent and its model provider and does the conversion automatically:

  • Paste an image in your agent, and the local proxy rewrites it into text before the request reaches the text-only model.
  • Ask the agent to inspect a local image, an image URL, or the latest image you pasted (see --latest), and it returns a factual description.
  • Keep your existing model, key, and workflow. Everything is local, reversible, and free by default.

Architecture

flowchart LR
  U[User pastes an image] --> A[Any AI agent]
  A -->|request with image| P[agent-vision proxy :19100]
  P --> V[OpenAI-compatible vision API]
  V -->|text description| P
  P -->|text-only request| M[DeepSeek / text-only model]

see mode skips the proxy: the image path is sent directly to the vision API and the returned text is used by the agent.

Supported Agents

Agent Integration Status
Codex Safe auto-patch: rewrites only the active provider's base_url to the local proxy, keeps wire_api and keys, and declares image input for the active model in a local model catalog (e.g. cc-switch) when present so pasted images and view_image are allowed; backup and rollback; see --latest recovers the last pasted image as a fallback Fully automatic
OpenCode Auto-patches opencode.json with an OpenAI-compatible provider Fully automatic
Claude Code Detected and guided; Claude speaks the Anthropic protocol, so a protocol-compatible gateway is required Manual steps provided
Cursor Detected and guided; Cursor exposes the base URL override only through Settings -> Models Manual steps provided

Supported Vision Providers

agent-vision accepts any OpenAI-compatible vision API. Built-in presets cover the most common ones; custom endpoints work too.

Provider Model examples Cost
Zhipu glm-4v-flash, glm-4.6v-flash Free
Alibaba DashScope qwen-vl-max, qwen3-vl-flash Pay-as-you-go / free quota
OpenAI gpt-4o-mini, gpt-4o Pay-as-you-go
Google Gemini gemini-2.0-flash Free tier available
Groq Qwen vision models Free plan available
SiliconFlow Qwen2.5-VL series Free quota for new users
OpenRouter Free and paid vision models Mixed
Self-hosted vLLM / Ollama Any VLM Hardware only

Click a provider name to open its official sign-up/console page and create an API key.

Install

One-line deploy (recommended)

Paste this into your AI agent:

Deploy agent-vision from https://github.com/SIMON-WORLD/codex-deepseek-vision per AGENT_INSTALL.md. Use the free Zhipu provider. Vision API key: <KEY>. Tell me when I need to restart Codex.

One-line install (recommended)

Install Python 3.9+, then run:

pip install codex-deepseek-vision
agent-vision setup

If PyPI is unreachable, install from the repository instead:

git clone https://github.com/SIMON-WORLD/codex-deepseek-vision.git
cd codex-deepseek-vision
pip install .
agent-vision setup

The wizard detects your agent, lets you pick Free / Quality / Custom vision, writes the config with a backup, starts the local runtime, verifies the connection, and prints the final health status. For Codex it only rewrites the active provider's base_url; model_provider, model, wire_api and API keys are left untouched.

You can also paste this into your agent and let it do the work:

Set up agent-vision for me. Read AGENT_INSTALL.md and follow it end to end. Use the free Zhipu provider unless I choose another one.

All user configuration lives in one directory: ~/.agent-vision/ on Linux/macOS, %USERPROFILE%\.agent-vision\ on Windows. Override it with AGENT_VISION_HOME if you prefer another location. The setup wizard creates and fills this directory automatically.

Runtime management

agent-vision start      # start the local vision proxy in the background
agent-vision status     # show installation, runtime, provider, agent and vision status
agent-vision restart    # restart the local proxy
agent-vision stop       # stop the local proxy

Rollback

agent-vision rollback codex
agent-vision rollback opencode

Every auto-patch creates a timestamped backup before modifying anything, and rollback restores it.

Configuration

agent-vision setup writes and manages .env inside the user config directory. For manual configuration, copy .env.example to ~/.agent-vision/.env (Windows: %USERPROFILE%\.agent-vision\.env) and fill in the vision API key. Zhipu keys use the {API Key ID}.{secret} format. Do not add quotes; the loader strips surrounding quotes and whitespace.

Variable Default Description
VISION_API_KEY - Vision API key (required)
VISION_BASE_URL https://open.bigmodel.cn/api/paas/v4 OpenAI-compatible endpoint
VISION_MODEL glm-4v-flash Vision model name
VISION_PROXY_UPSTREAM - Optional: URL the local proxy forwards to
VISION_PROXY_LISTEN 127.0.0.1:19100 Optional: local proxy listen address

For a custom provider, ask your agent to add one to providers.json in the user config directory; no code changes are needed. Entries there override built-in presets with the same id.

CLI Reference

# Analyze images on demand (local file, image URL, or latest pasted image)
agent-vision see <image-or-url>... [-q "question"] [--task describe|ocr|ui|chart] [--latest] [--provider ID] [--no-cache]

# Run the local image-strip proxy in the foreground
agent-vision proxy --listen 127.0.0.1:19100 --upstream <origin>

# Guided setup
agent-vision setup [--agent codex|opencode|claude|cursor] [--dry-run]

# Health status
agent-vision status [--test]

# Runtime lifecycle
agent-vision start | restart | stop

# Configuration check
agent-vision doctor

# List vision provider presets
agent-vision providers

Self-test in 3 minutes

Anyone with Python 3.9+ can verify the bridge on a fresh machine:

git clone https://github.com/SIMON-WORLD/codex-deepseek-vision.git
cd codex-deepseek-vision
pip install .
agent-vision setup
agent-vision status

Then paste an image in Codex or ask the agent to call view_image on a local image. For a zero-setup fresh machine, open this repository in GitHub Codespaces: the devcontainer pre-installs the package, and all commands above run the same way.

Testing

python -m unittest discover -s tests -v

FAQ

  • Do I need a GPU or Ollama? No. Vision is handled by a remote OpenAI-compatible API; the default Zhipu glm-4v-flash is free.
  • Is my agent key exposed? No. The proxy passes the original Authorization header through, so your main model key stays in the agent's existing config.
  • Why does Codex still refuse pasted images ("model does not support image input")? Codex decides whether the UI accepts pasted images from its model catalog. When you load models from a local catalog (e.g. cc-switch's model_catalog_json), setup now also declares image input for the active text-only model (with a timestamped backup; rollback codex restores it). If you switch models with cc-switch afterwards, that file may be regenerated — rerun agent-vision setup to re-apply.
  • Can the agent call Codex's built-in view_image? Yes. view_image sends the local image in a later request, and the same proxy converts it to text before the text-only model sees it. If your client refuses pasted images entirely, run agent-vision see --latest to recover the last image pasted into Codex from session files and analyze it directly.
  • Can I use a paid provider? Yes. Choose Quality or Custom in setup, or edit .env / providers.json.
  • What happens if the vision API fails? Proxy mode fails open and forwards the original request unchanged, so normal chat is not blocked.
  • Are images private? Images are sent only to the provider you configure (Zhipu by default). Review the provider policy before sending sensitive screenshots. see --latest extracts only the image bytes from Codex session files and never reads or sends conversation text. .env is gitignored; never commit or share it.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_deepseek_vision-1.0.4.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_deepseek_vision-1.0.4-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file codex_deepseek_vision-1.0.4.tar.gz.

File metadata

  • Download URL: codex_deepseek_vision-1.0.4.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for codex_deepseek_vision-1.0.4.tar.gz
Algorithm Hash digest
SHA256 849e8d562fa1b457fe6914cc47b314331389c53852d4a233e463abd8f5cf25ca
MD5 1d20065f9ca74d53dc955e694996de0b
BLAKE2b-256 98c9d8562ca7ff150bdb0e571fe608ec9f81cbf8f2f9c2f0e8bfa15701aa3c4d

See more details on using hashes here.

File details

Details for the file codex_deepseek_vision-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for codex_deepseek_vision-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7f5b396978f2d569f9b46d62bbd657cdaceea766e7324cb267a39591b5ae5651
MD5 f447c48021e0056086d7b8f2a3330ac1
BLAKE2b-256 2a9f4342f6cbc34d33f512f072c97b03d8cea2ba4402715cedc009ad079f13f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page