Skip to content

Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.

Merge PR #189 with #186: keep both Atlas Cloud and Cheaper Inference presets

yifanfeng9778346b6cface
diff --cc docs/en/concepts/provider-system.md
index 35624ee,bccee20..e49746e
--- a/docs/en/concepts/provider-system.md
+++ b/docs/en/concepts/provider-system.md
@@@ -1,6 -1,6 +1,10 @@@
# Provider System
++<<<<<<< HEAD
+Hyper-Extract supports these ways to connect to LLMs: **OpenAI**, **Anthropic**, **Google Gemini**, **Alibaba Bailian**, **DeepSeek**, **OrcaRouter**, **Cheaper Inference**, and **local vLLM**. All use the same `create_client()` interface — only the first line changes.
++=======
+ Hyper-Extract supports these ways to connect to LLMs: **OpenAI**, **Anthropic**, **Google Gemini**, **Alibaba Bailian**, **DeepSeek**, **OrcaRouter**, **Atlas Cloud**, and **local vLLM**. All use the same `create_client()` interface — only the first line changes.
++>>>>>>> pr-189-src
---
@@@ -15,7 -15,7 +19,11 @@@
| **Google Gemini** | gemini-3.8-flash / gemini-2.5-flash / gemini-2.5-pro | ✅ (tool calling) | ✅ | LLM only — no embedder path in this repo (pair with an OpenAI-compatible embedder). Needs `hyperextract[google]`. Keys: `GOOGLE_API_KEY` or `GEMINI_API_KEY`. Alias: `gemini` |
| **DeepSeek** | deepseek-v4-flash / deepseek-v4-pro | ✅ | ✅ | OpenAI-compatible. V4 models default to "thinking" mode, which Hyper-Extract auto-disables (`extra_body`) so structured extraction works. LLM only — no embeddings API. Keys: `DEEPSEEK_API_KEY` |
| **OrcaRouter** | `orcarouter/auto`, `openai/gpt-4o-mini`, `anthropic/claude-haiku-4-5`, `deepseek/...`, `gemini/...` | ✅ | ✅ | OpenAI-compatible gateway routing 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax, xAI behind one endpoint and key. Keys: `ORCAROUTER_API_KEY` |
++<<<<<<< HEAD
+| **Cheaper Inference** | gpt-5.4-mini | ✅ | ✅ | OpenAI-compatible gateway. One key gives access to models from several labs. LLM only — no embeddings API (pair with an OpenAI-compatible embedder). Keys: `CHEAPER_INFERENCE_API_KEY` |
++=======
+ | **Atlas Cloud** | `deepseek-ai/deepseek-v4-flash`, `deepseek-ai/deepseek-v4-pro`, `moonshotai/kimi-k3`, `qwen/qwen3.5-plus`, `openai/gpt-5.5`, `anthropic/claude-sonnet-4.6` | ✅ | ✅ | OpenAI-compatible gateway serving DeepSeek, Z.ai, Moonshot, Qwen, MiniMax, OpenAI, Anthropic and Google models under vendor-prefixed ids. LLM only — no embeddings API. `glm-5.x` models reject the forced `tool_choice` structured extraction uses; pick another model. Keys: `ATLASCLOUD_API_KEY` |
++>>>>>>> pr-189-src
| **Alibaba Bailian** | qwen-plus / qwen-turbo / qwen3.6-plus / deepseek-r1 | ✅ | ✅ | Works out of the box |
| **Alibaba Bailian** | qwen-max / deepseek-v3 | ❌ | ❌ | Only `json_object`; not compatible with function-calling structured output |
@@@ -81,11 -81,12 +89,20 @@@ llm, emb = create_client
# Key: ORCAROUTER_API_KEY (fallback: OPENAI_API_KEY).
llm, emb = create_client("orcarouter")
++<<<<<<< HEAD
+# Cheaper Inference — OpenAI-compatible gateway, one key for models from
+# several labs. No embeddings API, so pair it with an OpenAI-compatible embedder.
+# Key: CHEAPER_INFERENCE_API_KEY. Override model with "cheaperinference:gpt-5.4".
+llm, emb = create_client(
+ llm="cheaperinference", # default model: gpt-5.4-mini
++=======
+ # Atlas Cloud — OpenAI-compatible gateway with vendor-prefixed model ids
+ # (deepseek-ai/..., moonshotai/..., qwen/..., openai/..., anthropic/...).
+ # LLM only — pair it with an OpenAI-compatible embedder.
+ # Key: ATLASCLOUD_API_KEY. Override model with "atlascloud:moonshotai/kimi-k3".
+ llm, emb = create_client(
+ llm="atlascloud",
++>>>>>>> pr-189-src
embedder="openai:text-embedding-3-small",
)
diff --cc docs/en/python/guides/provider-configuration.md
index ee5a014,c3ebaa3..aa89c8d
--- a/docs/en/python/guides/provider-configuration.md
+++ b/docs/en/python/guides/provider-configuration.md
@@@ -1,6 -1,6 +1,10 @@@
# Provider Configuration Guide
++<<<<<<< HEAD
+Configure Hyper-Extract to work with OpenAI, Bailian (Alibaba Cloud), DeepSeek, OrcaRouter, Cheaper Inference, or local vLLM deployments.
++=======
+ Configure Hyper-Extract to work with OpenAI, Bailian (Alibaba Cloud), DeepSeek, OrcaRouter, Atlas Cloud, or local vLLM deployments.
++>>>>>>> pr-189-src
---
@@@ -64,18 -64,21 +68,36 @@@ llm, emb = create_client("orcarouter"
# Or override the model: create_client("orcarouter:openai/gpt-4o-mini", ...)
```
++<<<<<<< HEAD
+### Cheaper Inference
+
+```python
+from hyperextract import create_client
+
+# Cheaper Inference is an OpenAI-compatible gateway with one key for models
+# from several labs. It has no embeddings API, so pair it with another embedder.
+# Key: CHEAPER_INFERENCE_API_KEY.
+llm, emb = create_client(
+ llm="cheaperinference", # default model: gpt-5.4-mini
+ embedder="openai:text-embedding-3-small",
+)
++=======
+ ### Atlas Cloud
+
+ ```python
+ from hyperextract import create_client, AutoGraph
+
+ # Atlas Cloud is an OpenAI-compatible gateway (DeepSeek, Z.ai, Moonshot, Qwen,
+ # MiniMax, OpenAI, Anthropic, Google) with vendor-prefixed model ids.
+ # LLM only — pair it with an OpenAI-compatible embedder.
+ # Key: ATLASCLOUD_API_KEY (fallback: OPENAI_API_KEY).
+ llm, emb = create_client(
+ llm="atlascloud",
+ embedder="openai:text-embedding-3-small",
+ )
+ # Or override the model: create_client(llm="atlascloud:moonshotai/kimi-k3", ...)
+ # Avoid glm-5.x here: it rejects the forced tool_choice that extraction uses.
++>>>>>>> pr-189-src
```
### Local vLLM
@@@ -118,7 -121,7 +140,11 @@@ print(f"Nodes: {len(graph.nodes)}, Edge
| **Anthropic** | `he config llm -p anthropic -k sk-ant-xxx` + `he config embedder -p openai -k sk-xxx` |
| **DeepSeek** | `he config llm -p deepseek -k sk-xxx` + `he config embedder -p openai -k sk-xxx` |
| **OrcaRouter** | `he config init -p orcarouter -k sk-orca-xxx` |
++<<<<<<< HEAD
+| **Cheaper Inference** | `he config llm -p cheaperinference -m gpt-5.4-mini -k ci_live_xxx` + `he config embedder -p openai -k sk-xxx` |
++=======
+ | **Atlas Cloud** | `he config llm -p atlascloud -k xxx` + `he config embedder -p openai -k sk-xxx` |
++>>>>>>> pr-189-src
| **vLLM** | `he config init` → select "local vLLM" |
| **Mixed** (LLM=Bailian, Embedder=vLLM) | `he config llm -p bailian -k sk-xxx` + `he config embedder -p vllm -u http://localhost:8001/v1 -k dummy` |
diff --cc hyperextract/utils/client.py
index ef0b64d,ac38a02..47e089d
--- a/hyperextract/utils/client.py
+++ b/hyperextract/utils/client.py
@@@ -63,14 -63,17 +63,25 @@@ PROVIDER_PRESETS: dict[str, dict[str, s
"default_llm": "orcarouter/auto",
"default_embedder": "openai/text-embedding-3-small",
},
+ # Cheaper Inference. OpenAI-compatible LLM gateway with one key for models
+ # from several labs, using bare model ids such as "gpt-5.4-mini". It has no
+ # embeddings API — pair it with an OpenAI-compatible embedder.
+ "cheaperinference": {
+ "base_url": "https://api.cheaperinference.com/v1",
+ "default_llm": "gpt-5.4-mini",
+ "default_embedder": None,
+ },
+ # Atlas Cloud. OpenAI-compatible aggregator serving DeepSeek, Z.ai, Moonshot,
+ # Qwen, MiniMax, OpenAI, Anthropic and Google models under vendor-prefixed
+ # ids such as "deepseek-ai/deepseek-v4-flash". Forced tool_choice (which
+ # method="function_calling" relies on) works for these models without
+ # disabling thinking, except glm-5.x, which answers 400. Atlas Cloud has no
+ # embeddings API — pair it with an OpenAI-compatible embedder.
+ "atlascloud": {
+ "base_url": "https://api.atlascloud.ai/v1",
+ "default_llm": "deepseek-ai/deepseek-v4-flash",
+ "default_embedder": None,
+ },
# Anthropic (Claude). Uses the native ChatAnthropic client, so base_url is
# left empty (the SDK targets api.anthropic.com by default). Anthropic has
# no embeddings API, hence default_embedder is None — pair it with an
@@@ -121,7 -124,7 +132,8 @@@ PROVIDER_API_KEY_ENV: dict[str, tuple[s
"gemini": ("GOOGLE_API_KEY", "GEMINI_API_KEY"),
"deepseek": ("DEEPSEEK_API_KEY",),
"orcarouter": ("ORCAROUTER_API_KEY",),
+ "cheaperinference": ("CHEAPER_INFERENCE_API_KEY",),
+ "atlascloud": ("ATLASCLOUD_API_KEY",),
}
diff --cc tests/cli/test_config.py
index 9cedcf8,1e6b7ad..cbc5011
--- a/tests/cli/test_config.py
+++ b/tests/cli/test_config.py
@@@ -309,44 -309,33 +309,74 @@@ def test_legacy_broken_google_embedder_
)
+def test_quick_init_warns_when_provider_has_no_default_llm(tmp_path, monkeypatch):
+ """`he config init` has no --model flag, so a preset-less provider (vllm)
+ must say the written model is a placeholder."""
+ from typer.testing import CliRunner
+
+ from hyperextract.cli.cli import app
+
+ cfg_path = _isolate_default_config(tmp_path, monkeypatch)
+ result = CliRunner().invoke(
+ app,
+ [
+ "config",
+ "init",
+ "-p",
+ "vllm",
+ "-k",
+ "dummy",
+ "-u",
+ "http://localhost:8000/v1",
+ ],
+ )
+
+ assert result.exit_code == 0, result.output
+ assert "no default LLM" in result.output
+ assert "he config llm -p vllm -m" in result.output
+ # The placeholder is still written (LLMConfig.model has a repo-wide default).
+ assert _read_init_toml(cfg_path)["llm"]["provider"] == "vllm"
+
+
+def test_quick_init_does_not_warn_when_preset_has_default_llm(tmp_path, monkeypatch):
+ from typer.testing import CliRunner
+
+ from hyperextract.cli.cli import app
+
+ _isolate_default_config(tmp_path, monkeypatch)
+ result = CliRunner().invoke(
+ app, ["config", "init", "-p", "deepseek", "-k", _FAKE_API_KEY]
+ )
+
+ assert result.exit_code == 0, result.output
+ assert "no default LLM" not in result.output
+ def test_atlascloud_is_a_library_preset_with_its_own_key_env():
+ """The CLI reads Atlas Cloud from the library tables, not a copy."""
+ from hyperextract.cli import config as cli_config
+
+ assert "atlascloud" in cli_config.PROVIDER_PRESETS
+ assert cli_config.PROVIDER_API_KEY_ENV["atlascloud"] == ("ATLASCLOUD_API_KEY",)
+
+
+ def test_get_llm_config_reads_atlascloud_env_key(tmp_path, monkeypatch):
+ """Empty toml api_key must resolve ATLASCLOUD_API_KEY, ahead of OPENAI_API_KEY."""
+ monkeypatch.delenv("OPENAI_BASE_URL", raising=False)
+ monkeypatch.setenv("OPENAI_API_KEY", "sk-openai-must-not-win")
+ monkeypatch.setenv("ATLASCLOUD_API_KEY", "apikey-atlas-from-env")
+
+ cm = ConfigManager(tmp_path / "config.toml")
+ cm.set_llm(provider="atlascloud", model="deepseek-ai/deepseek-v4-flash", api_key="")
+ cfg = cm.get_llm_config()
+
+ assert cfg.api_key == "apikey-atlas-from-env"
+ assert cfg.base_url == "https://api.atlascloud.ai/v1"
+
+
+ def test_interactive_init_lists_atlascloud():
+ """he config init provider list includes Atlas Cloud."""
+ import inspect
+
+ from hyperextract.cli.commands.config import init
+
+ assert '"atlascloud"' in inspect.getsource(init)
+