Peke ki ngā ihirangi
OpenCode

Ngā kaiwhakahaere code

Whakamahia a OpenCode me Shannon

Tāpirihia a Shannon hei kaiwhakarato i opencode.json, ā, ka whakamahere, ka whakatika, ka whakahaere waehere a OpenCode i runga i ngā model Shannon.

  • I whakamātauria 7 Noe 2026
  • OpenAI Chat Completions
  • Tata ki te 3 meneti

Mō OpenCode

He kaitono waehere mātāmuri-tuwhera a OpenCode me tētahi atanga terminal, he taupānga papamahi me ngā toronga IDE. Ka mahi me ētahi kaiwhakarato model maha, ka whakamahere, ka whakatika waehere mā āna ake taputapu, ā, ka pupuri i ngā huihuinga ka taea te hoki atu. Ka tāpiri tētahi poraka kaiwhakarato i opencode.json i a Shannon ki te taha o ngā kaiwhakarato kei te whakamahia e koe.

Ngā mea e hiahiatia ana

He API key Shannon
Ngā kī me te whakamahinga
URL pūtake
https://api.shannon-ai.com/v1 Pito mutunga: /v1/chat/completions
Ka whai ia wāhanga waehere i raro iho i tō kōwhiringa.

Whakaritea

  1. Kawea atu tō API key

    Ka pānui te whirihora i a ia hei {env:SHANNON_API_KEY}, nō reira ka noho te key ki waho i te kōnae.

    Shell
    export SHANNON_API_KEY=YOUR_API_KEY
  2. Tāpirihia a Shannon hei kaiwhakarato

    Whakanohoia tēnei ki ~/.config/opencode/opencode.json mō ia kaupapa, ki opencode.json rānei i te pūtake o tētahi kaupapa. Ka kī te limit.context ki a OpenCode ā hea whakapoto ai i te kōrero.

    ~/.config/opencode/opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "shannon": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Shannon",
          "options": {
            "baseURL": "https://api.shannon-ai.com/v1",
            "apiKey": "{env:SHANNON_API_KEY}"
          },
          "models": {
            "Kimi-K3-uncensored-NVFP4": {
              "name": "Kimi-K3-uncensored-NVFP4",
              "limit": { "context": 1022976, "output": 262144 }
            }
          }
        }
      },
      "model": "shannon/Kimi-K3-uncensored-NVFP4"
    }
  3. Whakahaerehia a OpenCode

    Tīmataria opencode i tō kaupapa, hoatu rānei he mahi kotahi mā opencode run. Ka whakawhiti te /models i waenga i ngā id i rārangihia e koe.

    Shell
    opencode run "Run the tests and fix what fails."
    OpenCode i tētahi terminal i runga i te model Shannon Kimi-K3-uncensored-NVFP4: ka whakahaere i ngā whakamātautau, ka whakatika i ngā hapa e rua, ā, ka whiti ngā whakamātautau
    He rere tūturu i runga i a OpenCode 1.19.5: kua whakahaerehia ngā whakamātautau, e rua ngā whakatika, ngā whakamātautau katoa e whiti ana.

Tirohia kei te mahi

Tukuna: He aha tā tēnei kaupapa e mahi ai?

Me kite koe i: Ka pānui a OpenCode i ō kōnae, ā, ka whakautu; ka whakaatu te rārangi tūnga i te shannon/<id>.

Ngā model e hāngai ana ki OpenCode

Ka tutuki i ia id i raro iho ngā hiahia o OpenCode. Ko te tuatahi te taunoa i ngā wāhanga waehere.

Id tauiraMatapihi horopakiOutput nui rawaInput whakaahua
Kimi-K3-uncensored-NVFP4 1,022,976 262,144 Āe
shannon-coder-1 131,072 65,536 Kāo
Kimi-K3.1-Pro-uncensored-NVFP4 1,022,976 262,144 Āe
Kimi-K3-uncensored-3BIT-REAP 225,280 225,280 Āe
shannon-3 196,608 65,536 Āe

Ngā tautuhinga model

Ka tono a OpenCode i ēnei uara. Ka whai rātou i te model i kōwhiria e koe.

TautuhingaUaraHe aha ai
limit.context 1022976 Te matapihi o te model; ka whakapoto a OpenCode i mua i a ia.
limit.output 262144 Te whakautu roa rawa.

He pai kia mōhio

  • Ka pānui a OpenCode 1.19 i te poraka provider e whakaaturia ana i konei. Ka tāmia te āhua providers / package / settings hou i te kaupapa tuihono a OpenCode e 1.19 ("Omitted native setting"), ā, ka tatari a OpenCode me te kore model.
  • I roto i tētahi tuhinga, katia te tāuru paerewa: opencode run "…" < /dev/null. Mēnā kāore he terminal, ka tatari tuatahi te opencode run mō te tāuru.
  • Rārangitia ētahi id ki raro i te models hei whakawhiti i waenga i a rātou mā te /models.

Ngā tohutohu

  1. Whakanohoia te kaiwhakarato ki ~/.config/opencode/opencode.json hei whakamahi i ia kaupapa, ki opencode.json rānei i te pūtake o te kaupapa mō tētahi kaupapa kotahi.
  2. Patohia /models i te atanga hei whakawhiti i waenga i ngā id kua rārangihia i raro i te kaiwhakarato.
  3. Whakaritea te limit.context me te limit.output mō ia model kia mōhio a OpenCode ā hea whakapoto ai.
  4. Ka whakahaere te opencode run "…" < /dev/null i tētahi mahi me te kore atanga, mō ngā tuhinga.

Te whakatika raruraru

TohuTakeWhakatika
Ka tīmata a OpenCode, ā, ka tatari mō ake tonu Ka whakamahi te whirihora i te providers (tini), ka whakarerea e tēnei putanga, nō reira kāore he model kua kōwhiria; he tatari rānei te opencode run i te tāuru paerewa. Whakamahia te provider me te npm, options me te models pēnei i runga ake nei; i ngā tuhinga tāpirihia te < /dev/null.
401 Kāore i whakaritea te SHANNON_API_KEY i te wāhi e tīmata ai a OpenCode. Kawea atu, tuhia rānei te key ki te options.apiKey.
"Model not found" Kāore te uara model e rite ki tētahi kaiwhakarato me te id model. Tuhia hei shannon/<id>, me te id pēnei tonu i te rārangi i raro i te models.
401 Unauthorized Kei te ngaro te key, kua hē te pato, kua hurihia rānei. Tāruatia anō te key mai i Keys & usage; ka tīmata ki te sk-.
context_length_exceeded, te karere "prompt is too long" rānei He roa ake te kōrero i te matapihi horopaki o te model. Tīmatahia he kōrerorero hou, tukuna te taputapu kia whakamāmā, kōwhiria rānei he model he nui ake te matapihi.
insufficient_quota Kāore e rawaka tō toenga hei utu i te tono. Tāpiri nama, huri mahere rānei; kāore te tono e ngana anō ko ia anake.

Ngā pātai

Ka mahi a OpenCode me Shannon?

Āe, hei kaiwhakarato ritenga me te package @ai-sdk/openai-compatible me te base URL https://api.shannon-ai.com/v1.

Ko tēhea model hei whakamahi mā OpenCode?

He model he karanga taputapu, he matapihi roa hoki, pērā i te Kimi-K3-uncensored-NVFP4; e tau ana te shannon-coder-1 mō ngā mahi poto ake.

Kōwhiria tō reo

He ōrite ngā reo katoa. Kōwhiria te reo e hiahia ana koe ki te whakamahi.

Ūropi

Te Rāwhiti Waenga me Āwherika ki te Raki

Āhia ki te Tonga

Āhia ki te Tonga-ma-Rāwhiti

Āhia ki te Rāwhiti

Āhia Waenga me Kōkahu

Āwherika

Te Moana-nui-a-Kiwa

Reo Hanga me te Reo Tawhito