fuzhengwei / fuzhengwei/WaLiCode

本地ollama模型连接失败

Open
#126 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
133
Forks
11
PR merge metrics
No merged PRs in 30d

Description

老板你好,我自己测试本地ollama是可以用而且速度还不错的,但使用咱们软件就报403

curl -N http://192.168.10.133:11434/api/chat -H "Content-Type: application/json" -d "{\"model\":\"ornith:35b\",\"messages\":[{\"role\":\"user\",\"content\":\"你好呀\"}],\"stream\":true,\"options\":{\"think\":false,\"num_thread\":16,\"num_ctx\":8192}}"

{"model":"ornith:35b","created_at":"2026-07-03T03:16:48.712352979Z","message":{"role":"assistant","content":"","thinking":"用户"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:48.805279769Z","message":{"role":"assistant","content":"","thinking":"用"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:48.894693118Z","message":{"role":"assistant","content":"","thinking":"中文"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:48.984354789Z","message":{"role":"assistant","content":"","thinking":"打招呼"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.073534782Z","message":{"role":"assistant","content":"","thinking":","},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.162620342Z","message":{"role":"assistant","content":"","thinking":"我应该"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.252079878Z","message":{"role":"assistant","content":"","thinking":"用"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.338286769Z","message":{"role":"assistant","content":"","thinking":"中文"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.427600678Z","message":{"role":"assistant","content":"","thinking":"友好"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.515604383Z","message":{"role":"assistant","content":"","thinking":"地"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.602302801Z","message":{"role":"assistant","content":"","thinking":"回应"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.691373121Z","message":{"role":"assistant","content":"","thinking":"并"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.780459672Z","message":{"role":"assistant","content":"","thinking":"询问"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.867212567Z","message":{"role":"assistant","content":"","thinking":"是否需要"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:49.959054747Z","message":{"role":"assistant","content":"","thinking":"帮助"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.050870328Z","message":{"role":"assistant","content":"","thinking":"。"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.408366822Z","message":{"role":"assistant","content":"你好"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.49870664Z","message":{"role":"assistant","content":"!"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.588343339Z","message":{"role":"assistant","content":"有什么"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.678401825Z","message":{"role":"assistant","content":"我可以"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.76830767Z","message":{"role":"assistant","content":"帮"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.858494398Z","message":{"role":"assistant","content":"你的"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:50.948650115Z","message":{"role":"assistant","content":"吗"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:51.039122387Z","message":{"role":"assistant","content":"?"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:51.129278209Z","message":{"role":"assistant","content":"😊"},"done":false}
{"model":"ornith:35b","created_at":"2026-07-03T03:16:51.219135087Z","message":{"role":"assistant","content":""},"done":true,"done_reason":"stop","total_duration":3487160580,"load_duration":804657874,"prompt_eval_count":70,"prompt_eval_duration":171714000,"eval_count":29,"eval_duration":2506298000}

咱们软件:

Image

与 AI 通信出错,请稍后重试。
Error: ❌ API Error (403): Forbidden

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure against the Ollama endpoint shown in the report and compare its successful curl request with the request made by WaLiCode. Trace the Ollama integration and API error handling, then verify that the application can connect to the local model without returning 403 and that the existing error path still behaves correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama
Domain
ai, api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.