التشغيل عبر Google Vertex AI
Google Vertex AI
ما هذه الصفحة، وماذا تحتوي.
المزوّد والنموذج: المزوّد هو الشركة التي تشغّل نموذج الذكاء الاصطناعي، والنموذج هو «العقل» الذي يفكّر لـHermes. Hermes نفسه لا يفكّر؛ هو ينظّم العمل ويستدعي النموذج. لذلك اختيار النموذج يحدّد جودة النتيجة وتكلفتها. ستستعمل هنا hermes model وhermes setup، والقراءة نحو 5 دقائق. انتبه: الأغلى ليس دائمًا الأفضل لمهمتك. جرّب مهمة واحدة على نموذجين وقارن، وضع سقفًا للإنفاق من البداية.
Use Hermes Agent with Gemini on Google Cloud Vertex AI — OAuth2 service account or ADC, GCP billing and quotas, no static API key
نتائج مأخوذة من هذه الصفحة، لا من قالب.
- تعرف ما المزوّد والنموذج ولماذا قد تحتاجه.
- تنفّذ
hermes modelوhermes setupوتفهم ما يحدث بعدها. - تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
- تضبط
VERTEX_CREDENTIALS_PATHفي المكان الصحيح.
كما تظهر تمامًا داخل Hermes.
hermes modelhermes setuphermes chathermes doctor
VERTEX_CREDENTIALS_PATHGOOGLE_APPLICATION_CREDENTIALSVERTEX_PROJECT_IDVERTEX_REGION
انتقل مباشرة إلى ما تحتاجه.
بلا اختصار أو حذف.
النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.
Hermes Agent supports Gemini models on Google Cloud Vertex AI through Vertex's OpenAI-compatible endpoint. Unlike the Google AI Studio provider (which uses a static API key against generativelanguage.googleapis.com), Vertex gives you enterprise-grade rate limits and GCP billing/credits, and is the right choice when you want Gemini usage to draw on your Google Cloud account rather than an AI Studio key.
Prerequisites
أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes setup.
- A Google Cloud project with the Vertex AI API enabled and billing active.
- Credentials, one of:
- a service-account JSON key file with the
roles/aiplatform.userrole, or - Application Default Credentials via
gcloud auth application-default login(or the metadata server when running on a GCP VM). google-auth— installed automatically the first time you select Vertex (lazy install). Runhermes setupto repair a managed install if that fails.
Quick Start
خطوات عملية بالترتيب. نفّذ خطوة وتأكد أنها نجحت قبل الانتقال للتالية. الأوامر هنا: hermes chat، hermes model.
# Option A — service account JSON (recommended for servers / gateways)
echo "VERTEX_CREDENTIALS_PATH=/path/to/service-account.json" >> ~/.hermes/.env
# Option B — Application Default Credentials (good for local dev)
gcloud auth application-default login
# Select Vertex as your provider
hermes model
# → Choose "More providers..." → "Google Vertex AI"
# → Enter your GCP project ID (or leave blank to use the one in your credentials)
# → Choose a region (default: global)
# → Select a Gemini model
# Start chatting
hermes chatConfiguration
إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. تضبط VERTEX_CREDENTIALS_PATH، GOOGLE_APPLICATION_CREDENTIALS خارج المحادثة، في بيئة التشغيل.
Vertex splits its settings by sensitivity:
- The credential path is a pointer to a secret and lives in
~/.hermes/.env. - Project ID and region are non-secret routing settings and live in
~/.hermes/config.yaml.
~/.hermes/.env:
# One of these (checked in this order); omit both to use ADC:
VERTEX_CREDENTIALS_PATH=/path/to/service-account.json
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json~/.hermes/config.yaml:
model:
default: google/gemini-3-flash-preview
provider: vertex
vertex:
project_id: my-gcp-project # blank → use the project embedded in the credentials
region: global # "global" is required for the Gemini 3.x previewsHow authentication works
- Hermes resolves credentials in this order:
VERTEX_CREDENTIALS_PATH→GOOGLE_APPLICATION_CREDENTIALS→ ADC. - It mints an OAuth2 access token (
cloud-platformscope) and caches it, refreshing when the token is within 5 minutes of expiry. - The token is handed to a standard OpenAI client pointed at the Vertex endpoint:
https://aiplatform.googleapis.com/v1beta1/projects/{project}/locations/{region}/endpoints/openapiRegional locations use a {region}-aiplatform.googleapis.com host instead.
- If a session runs longer than the token lifetime and a request returns
401, Hermes re-mints the token and retries automatically. On a long-running gateway, if ADC's refresh token has itself expired, Hermes falls back to the service-account JSON when one is configured.
Available Models
جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط. الأوامر هنا: hermes model.
Vertex requires the google/ vendor prefix on model IDs. The hermes model picker offers:
| Model | ID |
|---|---|
| Gemini 3.1 Pro Preview | google/gemini-3.1-pro-preview |
| Gemini 3 Pro Preview | google/gemini-3-pro-preview |
| Gemini 3 Flash Preview | google/gemini-3-flash-preview |
| Gemini 3.1 Flash Lite Preview | google/gemini-3.1-flash-lite-preview |
| Gemini 2.5 Pro | google/gemini-2.5-pro |
| Gemini 2.5 Flash | google/gemini-2.5-flash |
Switching Models Mid-Session
أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes model.
/model google/gemini-3-pro-preview
/model google/gemini-3-flash-preview/model switches among already-configured providers and models; it does not collect new credentials. Configure Vertex with hermes model first.
Reasoning / Thinking
شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: المزوّد هو الشركة التي تشغّل نموذج الذكاء الاصطناعي، والنموذج هو «العقل» الذي يفكّر لـHermes.
Vertex exposes Gemini's thinking budget through the OpenAI-compatible surface. Hermes maps its reasoning-effort setting onto extra_body.google.thinking_config automatically, so reasoning_effort works the same way it does on other Gemini surfaces.
Diagnostics
أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes doctor.
hermes doctorThe doctor reports whether Vertex credentials can be resolved (service-account path or ADC) and whether the provider is configured.
Troubleshooting
قسم لحل المشكلات. ابحث فيه عن العطل الذي يشبه حالتك بدل قراءته كاملًا. الأوامر هنا: hermes setup.
"Vertex AI credentials could not be resolved"
Hermes found neither a service-account JSON nor working ADC. Either set VERTEX_CREDENTIALS_PATH in ~/.hermes/.env, or run gcloud auth application-default login. If your project isn't embedded in the credentials, set vertex.project_id in config.yaml.
google-auth not installed
Hermes lazy-installs it the first time you select the Vertex provider. If that fails, run hermes setup to repair the managed install.
404 on Gemini 3.x models
You are probably on a regional endpoint. Set region: global in the vertex: section of config.yaml (or unset VERTEX_REGION).
403 / permission denied
The service account (or your ADC identity) needs the roles/aiplatform.user role on the project, and the Vertex AI API must be enabled for that project.
4 أسئلة إجاباتها كلها في هذه الصفحة.
كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.